Skip to content

Commit

Permalink
Fix ziplist length updates on bigendian platforms (redis#2080)
Browse files Browse the repository at this point in the history
Adds call to intrev16ifbe to ensure ZIPLIST_LENGTH is compared correctly

(cherry picked from commit eaa5271)
  • Loading branch information
robscary authored and oranagra committed Jul 18, 2021
1 parent 7f38aa8 commit 4c18123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ziplist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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); \
}

Expand Down

0 comments on commit 4c18123

Please sign in to comment.