From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 1580E3858401; Wed, 19 Jan 2022 14:31:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1580E3858401 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-3_3-branch] 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/cygwin-3_3-branch X-Git-Oldrev: 20525bb80d8b77c18bd1b0a441e60f480460b4ba X-Git-Newrev: c30c3026afe300666201a1edf7dd083311484675 Message-Id: <20220119143143.1580E3858401@sourceware.org> Date: Wed, 19 Jan 2022 14:31:43 +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:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Dc30c3026afe= 300666201a1edf7dd083311484675 commit c30c3026afe300666201a1edf7dd083311484675 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 cd56be45c..dedd7f51b 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 %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);