Skip to content

Commit 40fb125

Browse files
committed
URI parser needs to do printable ascii validation for string result
1 parent 75de16c commit 40fb125

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/ares_dns_parse.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,11 @@ static ares_status_t ares_dns_parse_rr_uri(ares__buf_t *buf, ares_dns_rr_t *rr,
632632
return status;
633633
}
634634

635+
if (!ares__str_isprint(name, remaining_len)) {
636+
ares_free(name);
637+
return ARES_EBADRESP;
638+
}
639+
635640
status = ares_dns_rr_set_str_own(rr, ARES_RR_URI_TARGET, name);
636641
if (status != ARES_SUCCESS) {
637642
ares_free(name);

0 commit comments

Comments
 (0)