Skip to content

Commit 0b76801

Browse files
committed
async-dns: handle CNAME at EOP
1 parent 2df7203 commit 0b76801

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/system/async-dns/async-dns-parse.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ lws_adns_iterate(lws_adns_q_t *q, const uint8_t *pkt, int len,
233233
n = lws_adns_parse_label(pkt, len, p, len - DHO_SIZEOF, &sp,
234234
sizeof(stack[0].name) -
235235
lws_ptr_diff_size_t(sp, stack[0].name));
236-
/* includes case name won't fit */
237236
if (n < 0)
238237
return -1;
239238

@@ -366,7 +365,7 @@ lws_adns_iterate(lws_adns_q_t *q, const uint8_t *pkt, int len,
366365

367366
p += n;
368367

369-
if (p + 14 > e)
368+
if (p > e)
370369
return -1;
371370
#if 0
372371
/* it should have exactly reached rrpaylen if only one
@@ -727,6 +726,8 @@ lws_adns_parse_udp(lws_async_dns_t *dns, const uint8_t *pkt, size_t len)
727726
*/
728727

729728
fail_out:
729+
if (q->go_nogo != METRES_GO)
730+
lws_async_dns_complete(q, NULL);
730731
lws_adns_q_destroy(q);
731732
}
732733

0 commit comments

Comments
 (0)