aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/libc
diff options
context:
space:
mode:
authorAnton Lavrentiev via Cygwin-patches <cygwin-patches@cygwin.com>2022-01-19 08:12:55 -0500
committerCorinna Vinschen <corinna@vinschen.de>2022-01-19 15:26:14 +0100
commit93511d575ed3a838cd4943a4e24c787d5a0c679d (patch)
tree907c900019126e84d6b9f5fc1bac7d49175420be /winsup/cygwin/libc
parent4a7461a07b5af77dcbf9bae6e2a27141eb189f79 (diff)
downloadnewlib-93511d575ed3a838cd4943a4e24c787d5a0c679d.zip
newlib-93511d575ed3a838cd4943a4e24c787d5a0c679d.tar.gz
newlib-93511d575ed3a838cd4943a4e24c787d5a0c679d.tar.bz2
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
Diffstat (limited to 'winsup/cygwin/libc')
-rw-r--r--winsup/cygwin/libc/minires-os-if.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/winsup/cygwin/libc/minires-os-if.c b/winsup/cygwin/libc/minires-os-if.c
index c6fde77..4e8e9cf 100644
--- a/winsup/cygwin/libc/minires-os-if.c
+++ b/winsup/cygwin/libc/minires-os-if.c
@@ -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,
dnptrs, &dnptrs[DIM(dnptrs) - 1])) < 0) {
statp->res_h_errno = NETDB_INTERNAL; /* dn_comp sets errno */
+ AnsLength = 0;
len = -1;
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);
continue;
}
- section = rr->Flags.DW & 0x3;
+ section = rr->Flags.DW & 0x3;
ptr = write_record(ptr, rr, AnsPtr + AnsLength, dnptrs,
&dnptrs[DIM(dnptrs) - 1], debug);