]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
fixed bug #37705 Possible memory corruption in DNS query
authorSimon Goldschmidt <goldsimon@gmx.de>
Mon, 14 Jan 2013 17:04:04 +0000 (18:04 +0100)
committerSimon Goldschmidt <goldsimon@gmx.de>
Mon, 14 Jan 2013 17:04:04 +0000 (18:04 +0100)
src/core/dns.c

index 4e3a7deca6f9952b2ec220e4861f9b8414f2fcdf..90821a66c0e0eeb7a0b9ae756750e994bb8b67d3 100644 (file)
@@ -573,7 +573,7 @@ dns_send(u8_t numdns, const char* name, u8_t id)
   LWIP_ASSERT("dns server has no IP address set", !ip_addr_isany(&dns_servers[numdns]));
 
   /* if here, we have either a new query or a retry on a previous query to process */
-  p = pbuf_alloc(PBUF_TRANSPORT, SIZEOF_DNS_HDR + DNS_MAX_NAME_LENGTH +
+  p = pbuf_alloc(PBUF_TRANSPORT, SIZEOF_DNS_HDR + DNS_MAX_NAME_LENGTH + 1 +
                  SIZEOF_DNS_QUERY, PBUF_RAM);
   if (p != NULL) {
     u16_t realloc_size;