Jdesk / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

Incorrect data type when referencing the data size of an item. #70

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The item struct records the number of bytes as an int.  This should be
unsigned.

While in there, we should probably ensure that no reference to a size is
ever processed in a signed way.

Note that while size_t has been suggested, it may be inappropriate as the
size is generally assumed to be significantly less than 2^32 bytes long. 
Support for a 64-bit object size would probably require lots of changes we
don't expect to see here anyway.

(four gigs ought to be enough for any item)

Original issue reported on code.google.com by dsalli...@gmail.com on 4 Aug 2009 at 3:58

GoogleCodeExporter commented 9 years ago

Original comment by dsalli...@gmail.com on 4 Aug 2009 at 4:47

GoogleCodeExporter commented 9 years ago
Easy way to reproduce on the commandline:

printf 'set aaaaaa 0 10000 2147483647\r\nscoobyscoobydoo' | nc localhost 11211

Original comment by dsalli...@gmail.com on 4 Aug 2009 at 3:46

GoogleCodeExporter commented 9 years ago
Fixed in 
http://github.com/memcached/memcached/commit/483e82adc89c984cbe040857d9cf43fc725
883cd

Original comment by trond.no...@gmail.com on 26 Aug 2009 at 10:06