Fix potential NULL dref in btlib.c

This commit is contained in:
Stuart Reilly
2019-06-28 16:12:42 +01:00
parent 79634a6789
commit ef1b8e36a0
+1 -1
View File
@@ -423,7 +423,7 @@ const u_int8_t *bt_decode(const u_int8_t *b, size_t *l, int *ret, bt_parse_data_
int64_t d = 0;
u_int8_t c;
if(*l == 0) return NULL;
if(!l || *l == 0) return NULL;
if(cbd->level > BDEC_MAXDEPT) goto bad_data;
c = *b++; (*l)--;
if(c == 'i') { // integer