Fix crash in DHCP option parsing.

Thanks to Klaus Eisentraut <klaus.eisentraut@web.de> for finding this.
This commit is contained in:
Simon Kelley
2019-12-12 20:56:08 +00:00
parent 7d04e17444
commit 9e732445cf

View File

@@ -1469,7 +1469,7 @@ static int parse_dhcp_opt(char *errstr, char *arg, int flags)
}
/* RFC 3361, enc byte is zero for names */
if (new->opt == OPTION_SIP_SERVER)
if (new->opt == OPTION_SIP_SERVER && m)
m[0] = 0;
new->len = (int) len + header_size;
new->val = m;