X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/d4fb9f4144e72a7918e477c22a6c2a75d9c3c30d..4f948300bc26abb0aaa99343bc9f089ea98a9abe:/src/zipmap.c diff --git a/src/zipmap.c b/src/zipmap.c index 693db7b9..9f0fc718 100644 --- a/src/zipmap.c +++ b/src/zipmap.c @@ -80,6 +80,7 @@ #include #include #include "zmalloc.h" +#include "endian.h" #define ZIPMAP_BIGLEN 254 #define ZIPMAP_END 255 @@ -108,6 +109,7 @@ static unsigned int zipmapDecodeLength(unsigned char *p) { if (len < ZIPMAP_BIGLEN) return len; memcpy(&len,p+1,sizeof(unsigned int)); + memrev32ifbe(&len); return len; } @@ -123,6 +125,7 @@ static unsigned int zipmapEncodeLength(unsigned char *p, unsigned int len) { } else { p[0] = ZIPMAP_BIGLEN; memcpy(p+1,&len,sizeof(len)); + memrev32ifbe(p+1); return 1+sizeof(len); } }