DNS_MAX_SOURCE_PORTS is PP-checked to be <= 255...

This commit is contained in:
goldsimon 2017-06-26 08:48:17 +02:00
parent 5efe26ebd3
commit 092c6c1f07

View File

@ -913,7 +913,7 @@ dns_alloc_pcb(void)
/* if we come here, creating a new UDP pcb failed, so we have to use
an already existing one (so overflow is no issue) */
for (i = 0, idx = (u8_t)(dns_last_pcb_idx + 1); i < DNS_MAX_SOURCE_PORTS; i++, idx++) {
if (idx >= LWIP_MAX(0xFF, DNS_MAX_SOURCE_PORTS)) {
if (idx >= DNS_MAX_SOURCE_PORTS) {
idx = 0;
}
if (dns_pcbs[idx] != NULL) {