fix assert problem in ZIP_DECODE_PREVLENSIZE

, see issue: https://github.com/antirez/redis/issues/4587
This commit is contained in:
qinchao 2018-01-16 22:43:06 +08:00
parent 0cc43760d7
commit 1e0e168570

View File

@ -440,7 +440,7 @@ unsigned int zipStorePrevEntryLength(unsigned char *p, unsigned int len) {
if ((prevlensize) == 1) { \ if ((prevlensize) == 1) { \
(prevlen) = (ptr)[0]; \ (prevlen) = (ptr)[0]; \
} else if ((prevlensize) == 5) { \ } else if ((prevlensize) == 5) { \
assert(sizeof((prevlensize)) == 4); \ assert(sizeof((prevlen)) == 4); \
memcpy(&(prevlen), ((char*)(ptr)) + 1, 4); \ memcpy(&(prevlen), ((char*)(ptr)) + 1, 4); \
memrev32ifbe(&prevlen); \ memrev32ifbe(&prevlen); \
} \ } \