From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 1BA083857C7E; Wed, 19 Jan 2022 14:31:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1BA083857C7E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: resolver: cygwin_query() skip response header on internal error X-Act-Checkin: newlib-cygwin X-Git-Author: Anton Lavrentiev via Cygwin-patches X-Git-Refname: refs/heads/master X-Git-Oldrev: 4a7461a07b5af77dcbf9bae6e2a27141eb189f79 X-Git-Newrev: 93511d575ed3a838cd4943a4e24c787d5a0c679d Message-Id: <20220119143148.1BA083857C7E@sourceware.org> Date: Wed, 19 Jan 2022 14:31:48 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Jan 2022 14:31:48 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D93511d575ed= 3a838cd4943a4e24c787d5a0c679d commit 93511d575ed3a838cd4943a4e24c787d5a0c679d Author: Anton Lavrentiev via Cygwin-patches Date: Wed Jan 19 08:12:55 2022 -0500 Cygwin: resolver: cygwin_query() skip response header on internal error =20 - When dn_comp() failed internally there is no longer any need to fill the response header since it's now all cleared upon entry Diff: --- winsup/cygwin/libc/minires-os-if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/libc/minires-os-if.c b/winsup/cygwin/libc/minire= s-os-if.c index c6fde776a..4e8e9cf21 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 * D= omName, int Class, int Ty if ((len =3D dn_comp(rr->pName, ptr, AnsLength - 4, dnptrs, &dnptrs[DIM(dnptrs) - 1])) < 0) { statp->res_h_errno =3D NETDB_INTERNAL; /* dn_comp sets errno */ + AnsLength =3D 0; len =3D -1; goto done; } @@ -283,7 +284,7 @@ static int cygwin_query(res_state statp, const char * D= omName, int Class, int Ty DPRINTF(debug, "Unexpected section order for \"%s\" %d\n", DomName, = Type); continue; } - section =3D rr->Flags.DW & 0x3; + section =3D rr->Flags.DW & 0x3; =20 ptr =3D write_record(ptr, rr, AnsPtr + AnsLength, dnptrs, &dnptrs[DIM(dnptrs) - 1], debug);