Have sds buffers store sizes as unsigned #1188

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

scottjg commented Jul 11, 2013

@tnm tried to run KEYS against a slave of the GitHub production redis database with redis-cli today and we ran into a segfault in redis-cli after an sds buffer overflowed 2GB len. Seems reasonable to make it unsigned since the size should never be negative?

mattsta added a commit to mattsta/redis that referenced this pull request Aug 2, 2014

Use unsigned length in sds header
People have reported redis-cli segfaults because
of large sds allocations.

[Additional Fixes by matt:
  - add the unsigned storage class to sds in hiredis
  - convert sdsIncrLen from int to long so assert works]

All tests pass.

Fixes #1188

mattsta added a commit to mattsta/redis that referenced this pull request Aug 2, 2014

Use unsigned length in sds header
People have reported redis-cli segfaults because
of large sds allocations.

[Additional Fixes by matt:
  - add the unsigned storage class to sds in hiredis
  - convert sdsIncrLen from int to long so assert works]

All tests pass.

Fixes #1188

@mattsta mattsta referenced this pull request Aug 2, 2014

Closed

ALL simple issue fixes #1906

mattsta added a commit to mattsta/redis that referenced this pull request Aug 6, 2014

Use unsigned length in sds header
People have reported redis-cli segfaults because
of large sds allocations.

[Additional Fixes by matt:
  - add the unsigned storage class to sds in hiredis
  - convert sdsIncrLen from int to long so assert works]

All tests pass.

Fixes #1188
Contributor

mattsta commented Aug 25, 2014

Fixed in 68db7b1

@mattsta mattsta closed this Aug 25, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment