Przeglądaj źródła

ndb_redis: argument checking in redisc_free_reply

Vicente Hernando 13 lat temu
rodzic
commit
8d70484116
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      modules/ndb_redis/redis_client.c

+ 5 - 0
modules/ndb_redis/redis_client.c

@@ -482,6 +482,11 @@ int redisc_free_reply(str *name)
 	redisc_reply_t *rpl, *next_rpl;
 	redisc_reply_t *rpl, *next_rpl;
 	unsigned int hid;
 	unsigned int hid;
 
 
+	if(name==NULL || name->len==0) {
+		LM_ERR("invalid parameters");
+		return -1;
+	}
+
 	hid = get_hash1_raw(name->s, name->len);
 	hid = get_hash1_raw(name->s, name->len);
 
 
 	rpl = _redisc_rpl_list;
 	rpl = _redisc_rpl_list;