Skip to content

Increase size of range request in getrange - #1982

Merged
antirez merged 2 commits into
redis:unstablefrom
mattsta:fix-getrange-32bit
Sep 3, 2014
Merged

antirez merged 2 commits into
redis:unstablefrom
mattsta:fix-getrange-32bit

Conversation

@mattsta

@mattsta mattsta commented Sep 2, 2014

Copy link
Copy Markdown
Contributor

32 bit builds don't have a big enough long to capture
the same range as a 64 bit build. If we use "long long"
we get proper size limits everywhere.

The GETRANGE doc says large requests don't fail, they just return the entire contents of the string.

Fixes #1981

32 bit builds don't have a big enough long to capture
the same range as a 64 bit build.  If we use "long long"
we get proper size limits everywhere.

Also updates size of unsigned comparison to fit new size of `end`.

Fixes redis#1981
Previously, GETRANGE of a key containing nothing ("")
would allocate a large (size_t)-1 return value causing
crashes on 32bit builds when it tried to allocate the
4 GB return string.
antirez added a commit that referenced this pull request Sep 3, 2014
Increase size of range request in getrange
@antirez
antirez merged commit 0019479 into redis:unstable Sep 3, 2014
@antirez

antirez commented Sep 3, 2014

Copy link
Copy Markdown
Contributor

Thanks Matt! Merged.

@mattsta
mattsta deleted the fix-getrange-32bit branch November 20, 2014 20:30
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.

make test - ERR value is out of range (CentOS 6 32 bit)

2 participants