Re: [resend][PATCH] fs: use kernel's hex_to_bin() method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jan 5, 2011 at 1:21 AM, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> After which we can change your patch thusly:
>
> --- a/fs/binfmt_misc.c~fs-binfmt_miscc-use-kernels-hex_to_bin-method-fix
> +++ a/fs/binfmt_misc.c
> @@ -244,9 +244,7 @@ static int unquote(char *from)
>
> Â Â Â Âwhile ((c = *s++) != '\0') {
> Â Â Â Â Â Â Â Âif (c == '\\' && *s == 'x') {
> - Â Â Â Â Â Â Â Â Â Â Â s++;
> - Â Â Â Â Â Â Â Â Â Â Â *p = hex_to_bin(*s++) << 4;
> - Â Â Â Â Â Â Â Â Â Â Â *p++ |= hex_to_bin(*s++);
> + Â Â Â Â Â Â Â Â Â Â Â s = (char *)hex2bin(p, s + 1, 1);
We need to update both p and s.

In case of '\xAA\xBB' you have result -> '0xBB'.
Am I wrong?

> Â Â Â Â Â Â Â Â Â Â Â Âcontinue;
> Â Â Â Â Â Â Â Â}
> Â Â Â Â Â Â Â Â*p++ = c;


-- 
With Best Regards,
Andy Shevchenko
ÿô.nlj·Ÿ®‰­†+%ŠË±é¥Šwÿº{.nlj·¥Š{±ýþ)íèjg¬±¨¶‰šŽŠÝjÿ¾«þG«é¸¢·¦j:+v‰¨Šwèm¶Ÿÿþø®w¥þŠà£¢·hšâÿ†Ù



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux