Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BITCOUNT: fix segmentation fault. #582

Closed
wants to merge 1 commit into from

Conversation

trapezoid
Copy link
Contributor

remove unsafe and unnecessary cast.
until now, this cast may lead segmentation fault when end > UINT_MAX

example

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

remove unsafe and unnecessary cast.
until now, this cast may lead segmentation fault when end > UINT_MAX

# example
setbit foo 0 1
bitcount  0 4294967295
=> ok
bitcount  0 4294967296
=> cause segmentation fault.
@antirez
Copy link
Contributor

antirez commented Jul 20, 2012

Milestone set to 2.6, fixing asap, thanks for reporting.

@antirez
Copy link
Contributor

antirez commented Sep 5, 2012

Fix merged, thank you! I also changed the type of strlen to long to work with the same type, and added a regression test.

@antirez antirez closed this Sep 5, 2012
antirez added a commit that referenced this pull request Sep 5, 2012
Bug #582 was not present in 32 bit builds of Redis as
getObjectFromLong() will return an error for overflow.

This commit makes sure that the test does not fail because of the error
returned when running against 32 bit builds.
antirez added a commit that referenced this pull request Sep 5, 2012
Bug #582 was not present in 32 bit builds of Redis as
getObjectFromLong() will return an error for overflow.

This commit makes sure that the test does not fail because of the error
returned when running against 32 bit builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants