]> git.saurik.com Git - redis.git/commitdiff
BITCOUNT: fix segmentation fault.
authorHaruto Otake <trapezoid.g@gmail.com>
Sun, 15 Jul 2012 09:38:30 +0000 (18:38 +0900)
committerantirez <antirez@gmail.com>
Wed, 5 Sep 2012 14:19:04 +0000 (16:19 +0200)
remove unsafe and unnecessary cast.
until now, this cast may lead segmentation fault when end > UINT_MAX

setbit foo 0 1
bitcount  0 4294967295
=> ok
bitcount  0 4294967296
=> cause segmentation fault.

Note by @antirez: the commit was modified a bit to also change the
string length type to long, since it's guaranteed to be at max 512 MB in
size, so we can work with the same type across all the code path.

A regression test was also added.


No differences found