mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
in performing dns lookups, check result from res_mkquery
don't send a query that may be malformed.
This commit is contained in:
parent
5c43e1dbc8
commit
04bced403d
1 changed files with 4 additions and 0 deletions
|
@ -145,11 +145,15 @@ static int name_from_dns(struct address buf[static MAXADDRS], char canon[static
|
|||
if (family != AF_INET6) {
|
||||
qlens[nq] = __res_mkquery(0, name, 1, RR_A, 0, 0, 0,
|
||||
qbuf[nq], sizeof *qbuf);
|
||||
if (qlens[nq] == -1)
|
||||
return EAI_NONAME;
|
||||
nq++;
|
||||
}
|
||||
if (family != AF_INET) {
|
||||
qlens[nq] = __res_mkquery(0, name, 1, RR_AAAA, 0, 0, 0,
|
||||
qbuf[nq], sizeof *qbuf);
|
||||
if (qlens[nq] == -1)
|
||||
return EAI_NONAME;
|
||||
nq++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue