Cygwin: resolver: cygwin_query() skip response header on internal error

- When dn_comp() failed internally there is no longer any need to
fill the response header since it's now all cleared upon entry
This commit is contained in:
Anton Lavrentiev via Cygwin-patches 2022-01-19 08:12:55 -05:00 committed by Corinna Vinschen
parent 4a7461a07b
commit 93511d575e
1 changed files with 2 additions and 1 deletions

View File

@ -266,6 +266,7 @@ static int cygwin_query(res_state statp, const char * DomName, int Class, int Ty
if ((len = dn_comp(rr->pName, ptr, AnsLength - 4, if ((len = dn_comp(rr->pName, ptr, AnsLength - 4,
dnptrs, &dnptrs[DIM(dnptrs) - 1])) < 0) { dnptrs, &dnptrs[DIM(dnptrs) - 1])) < 0) {
statp->res_h_errno = NETDB_INTERNAL; /* dn_comp sets errno */ statp->res_h_errno = NETDB_INTERNAL; /* dn_comp sets errno */
AnsLength = 0;
len = -1; len = -1;
goto done; goto done;
} }
@ -283,7 +284,7 @@ static int cygwin_query(res_state statp, const char * DomName, int Class, int Ty
DPRINTF(debug, "Unexpected section order for \"%s\" %d\n", DomName, Type); DPRINTF(debug, "Unexpected section order for \"%s\" %d\n", DomName, Type);
continue; continue;
} }
section = rr->Flags.DW & 0x3; section = rr->Flags.DW & 0x3;
ptr = write_record(ptr, rr, AnsPtr + AnsLength, dnptrs, ptr = write_record(ptr, rr, AnsPtr + AnsLength, dnptrs,
&dnptrs[DIM(dnptrs) - 1], debug); &dnptrs[DIM(dnptrs) - 1], debug);