summaryrefslogtreecommitdiff
path: root/src/ziplist.c
diff options
context:
space:
mode:
authorRob Snyder <robscary@gmail.com>2021-06-30 09:46:06 -0400
committerGitHub <noreply@github.com>2021-06-30 16:46:06 +0300
commiteaa52719a355c4467d0383c1c9f5184c9c14fe5a (patch)
treee01d1409f03dcb91c3cc584b83ad5d2e8068a0a8 /src/ziplist.c
parent70dac4b4367485e0eddc1ae84b708cd14c18d626 (diff)
downloadredis-eaa52719a355c4467d0383c1c9f5184c9c14fe5a.tar.gz
Fix ziplist length updates on bigendian platforms (#2080)
Adds call to intrev16ifbe to ensure ZIPLIST_LENGTH is compared correctly
Diffstat (limited to 'src/ziplist.c')
-rw-r--r--src/ziplist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ziplist.c b/src/ziplist.c
index 4943010ee..ba4c85b35 100644
--- a/src/ziplist.c
+++ b/src/ziplist.c
@@ -263,7 +263,7 @@
* to stay there to signal that a full scan is needed to get the number of
* items inside the ziplist. */
#define ZIPLIST_INCR_LENGTH(zl,incr) { \
- if (ZIPLIST_LENGTH(zl) < UINT16_MAX) \
+ if (intrev16ifbe(ZIPLIST_LENGTH(zl)) < UINT16_MAX) \
ZIPLIST_LENGTH(zl) = intrev16ifbe(intrev16ifbe(ZIPLIST_LENGTH(zl))+incr); \
}