fixed bug #45004: dns response without answer might be discarded

This commit is contained in:
goldsimon 2015-08-19 10:33:42 +02:00
parent d850efdd08
commit 7263cc675b
2 changed files with 4 additions and 1 deletions

View File

@ -249,6 +249,9 @@ HISTORY
++ Bugfixes:
2015-08-19: Simon Goldschmidt (patch by "Sandra")
dns.c: fixed bug #45004: dns response without answer might be discarded
2015-08-18: Chrysn
timers.c: patch #8704 fix sys_timeouts_sleeptime function

View File

@ -1017,7 +1017,7 @@ dns_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr,
LWIP_UNUSED_ARG(port);
/* is the dns message big enough ? */
if (p->tot_len < (SIZEOF_DNS_HDR + SIZEOF_DNS_QUERY + SIZEOF_DNS_ANSWER)) {
if (p->tot_len < (SIZEOF_DNS_HDR + SIZEOF_DNS_QUERY)) {
LWIP_DEBUGF(DNS_DEBUG, ("dns_recv: pbuf too small\n"));
/* free pbuf and return */
goto memerr;