summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/dict.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libglusterfs/src/dict.c b/libglusterfs/src/dict.c
index 8849baf290a..5516a1f2132 100644
--- a/libglusterfs/src/dict.c
+++ b/libglusterfs/src/dict.c
@@ -3318,6 +3318,13 @@ dict_unserialize (char *orig_buf, int32_t size, dict_t **fill)
vallen = ntoh32 (hostord);
buf += DICT_DATA_HDR_VAL_LEN;
+ if ((keylen < 0) || (vallen < 0)) {
+ gf_msg_callingfn ("dict", GF_LOG_ERROR, 0,
+ LG_MSG_UNDERSIZED_BUF,
+ "undersized length passed "
+ "key:%d val:%d", keylen, vallen);
+ goto out;
+ }
if ((buf + keylen) > (orig_buf + size)) {
gf_msg_callingfn ("dict", GF_LOG_ERROR, 0,
LG_MSG_UNDERSIZED_BUF,