lkml.org 
[lkml]   [2015]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V2] lib/bitmap.c: fix some parsing issues and code style
From
On Wed, Jul 1, 2015 at 6:15 AM, Pan Xinhui <xinhuix.pan@intel.com> wrote:
>
> In __bitmap_parselist we can accept whitespaces on head or tail
> during every parsing procedure.
> If input has valid ranges, there is no reason to reject the user.
>
> fixes are:
> 1) if input ends with ',', bit 0 might be set unexpectedly.
> now we check if any digit is available after every loop.
> 2) if input has '0-', bit 0 might be set unexpectedly,
> now we return -EINVAL as this kind of input is definitely wrong.
> 3) minor code style fix in __bitmap_parse.
> and avoid in-loop incrementation of ndigits.

Why not three patches, so it becomes easier to see which is which?


> commit 2528a8b also add some check, but it's still not enough.
> it only correct the result in fix 1 above.

I believe the convention is to have at least 12 characters of the
sha1, with the title behind it: 2528a8b8f457 (__bitmap_parselist: fix
bug in empty string handling). Using only seven characters still risks
collisions.

Thanks,
Frans


\
 
 \ /
  Last update: 2015-07-01 08:41    [W:0.070 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site