summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Snyder <robscary@gmail.com>2021-06-30 09:46:06 -0400
committerOran Agra <oran@redislabs.com>2021-07-21 21:07:02 +0300
commit32d923f85aef7d241401c8b380e1a75c51d1a2d1 (patch)
tree29446a2142da9c4f3bf68bcb51e1ae51d5bc9038
parent8df81c032685600dd0657a0f28dde5c3d07283ff (diff)
downloadredis-32d923f85aef7d241401c8b380e1a75c51d1a2d1.tar.gz
Fix ziplist length updates on bigendian platforms (#2080)
Adds call to intrev16ifbe to ensure ZIPLIST_LENGTH is compared correctly (cherry picked from commit eaa52719a355c4467d0383c1c9f5184c9c14fe5a) (cherry picked from commit 4c181230855bb3f92e93b32a48db52e69bd7e509)
-rw-r--r--src/ziplist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ziplist.c b/src/ziplist.c
index 8721ace39..5933d1915 100644
--- a/src/ziplist.c
+++ b/src/ziplist.c
@@ -261,7 +261,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); \
}