diff --git a/src/redis-cli.c b/src/redis-cli.c index 3e447d6dc..488ca5f53 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -6050,6 +6050,7 @@ static clusterManagerNode *clusterManagerNodeMasterRandom(void) { } /* Can not be reached */ assert(0); + return NULL; } static int clusterManagerFixSlotsCoverage(char *all_slots) { diff --git a/src/zipmap.c b/src/zipmap.c index 83e857d4b..a04919ace 100644 --- a/src/zipmap.c +++ b/src/zipmap.c @@ -56,6 +56,7 @@ #include #include +#include #include "zmalloc.h" #include "endianconv.h" @@ -250,6 +251,7 @@ unsigned char *zipmapSet(unsigned char *zm, unsigned char *key, unsigned int kle /* Just write the key + value and we are done. */ /* Key: */ p += zipmapEncodeLength(p,klen); + assert(klen < freelen); memcpy(p,key,klen); p += klen; /* Value: */