[PATCH] getmntent: Consolidate character decoding
Siddhesh Poyarekar
siddhesh@sourceware.org
Tue Dec 15 09:41:17 GMT 2020
On 12/15/20 2:57 PM, Andreas Schwab wrote:
> On Dez 15 2020, Siddhesh Poyarekar via Libc-alpha wrote:
>
>> + else
>> + {
>> + /* The kernel escapes special characters with their octal
>> + equivalents. */
>> + char c = 64 * (rp[1] - '0') + 8 * (rp[2] - '0') + rp[3] - '0';
>> + *wp++ = c;
>> + rp += 3;
>
> That should check that the characters are indeed digits and you are not
> running past the end.
Indeed, I'll fix it up, thanks.
Siddhesh
More information about the Libc-alpha
mailing list