mdns_rfc.c: fix possible access of uninit. mem

Fixes: CID#207548
Change-Id: Ifa269d8a88d84c01349668cdd8d1f1d24c12c6d8
This commit is contained in:
Oliver Smith 2020-01-13 15:51:56 +01:00 committed by laforge
parent 4fa9653733
commit 74e7072f63
1 changed files with 6 additions and 1 deletions

View File

@ -83,7 +83,12 @@ char *osmo_mdns_rfc_qname_decode(void *ctx, const char *qname, size_t qname_max_
return NULL;
while (*qname) {
size_t len = *qname;
size_t len;
if (i >= qname_max_len)
return NULL;
len = *qname;
next_label = qname + len + 1;
if (next_label >= qname_end || i + len > OSMO_MDNS_RFC_MAX_NAME_LEN)