Author: bdubbs Date: 2012-08-27 16:05:32 -0600 (Mon, 27 Aug 2012) New Revision: 2523
Added: trunk/glibc/glibc-2.16.0-res_query_fix-1.patch Removed: trunk/glibc/glibc-2.16.0-res_query-fix-1.patch Log: Fix the name Deleted: trunk/glibc/glibc-2.16.0-res_query-fix-1.patch =================================================================== --- trunk/glibc/glibc-2.16.0-res_query-fix-1.patch 2012-08-27 21:53:19 UTC (rev 2522) +++ trunk/glibc/glibc-2.16.0-res_query-fix-1.patch 2012-08-27 22:05:32 UTC (rev 2523) @@ -1,59 +0,0 @@ -Submitted By: Bruce Dubbs <bdubbs_at_linuxfromscratch_dot_org> -Date: 2012-08-27 -Initial Package Version: 2.16.0 -Upstream Status: Not yet applied, but in other distros. -Origin: http://sourceware.org/bugzilla/attachment.cgi?id=5855 -Description: Fixes a problem with name resolution with errors - from some name servers. - ---- a/resolv/res_query.c -+++ a/resolv/res_query.c -@@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp, - int *resplen2) - { - HEADER *hp = (HEADER *) answer; -+ HEADER *hp2; - int n, use_malloc = 0; - u_int oflags = statp->_flags; - -@@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp, - /* __libc_res_nsend might have reallocated the buffer. */ - hp = (HEADER *) *answerp; - -- /* We simplify the following tests by assigning HP to HP2. It -- is easy to verify that this is the same as ignoring all -- tests of HP2. */ -- HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp; -- -- if (n < (int) sizeof (HEADER) && answerp2 != NULL -- && *resplen2 > (int) sizeof (HEADER)) -+ /* We simplify the following tests by assigning HP to HP2 or -+ vice versa. It is easy to verify that this is the same as -+ ignoring all tests of HP or HP2. */ -+ if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER)) - { -- /* Special case of partial answer. */ -- assert (hp != hp2); -- hp = hp2; -+ hp2 = hp; - } -- else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER) -- && n > (int) sizeof (HEADER)) -+ else - { -- /* Special case of partial answer. */ -- assert (hp != hp2); -- hp2 = hp; -+ hp2 = (HEADER *) *answerp2; -+ if (n < (int) sizeof (HEADER)) -+ { -+ hp = hp2; -+ } - } - -+ /* Make sure both hp and hp2 are defined */ -+ assert((hp != NULL) && (hp2 != NULL)); -+ - if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0) - && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) { - #ifdef DEBUG Copied: trunk/glibc/glibc-2.16.0-res_query_fix-1.patch (from rev 2522, trunk/glibc/glibc-2.16.0-res_query-fix-1.patch) =================================================================== --- trunk/glibc/glibc-2.16.0-res_query_fix-1.patch (rev 0) +++ trunk/glibc/glibc-2.16.0-res_query_fix-1.patch 2012-08-27 22:05:32 UTC (rev 2523) @@ -0,0 +1,59 @@ +Submitted By: Bruce Dubbs <bdubbs_at_linuxfromscratch_dot_org> +Date: 2012-08-27 +Initial Package Version: 2.16.0 +Upstream Status: Not yet applied, but in other distros. +Origin: http://sourceware.org/bugzilla/attachment.cgi?id=5855 +Description: Fixes a problem with name resolution with errors + from some name servers. + +--- a/resolv/res_query.c ++++ a/resolv/res_query.c +@@ -122,6 +122,7 @@ __libc_res_nquery(res_state statp, + int *resplen2) + { + HEADER *hp = (HEADER *) answer; ++ HEADER *hp2; + int n, use_malloc = 0; + u_int oflags = statp->_flags; + +@@ -239,26 +240,25 @@ __libc_res_nquery(res_state statp, + /* __libc_res_nsend might have reallocated the buffer. */ + hp = (HEADER *) *answerp; + +- /* We simplify the following tests by assigning HP to HP2. It +- is easy to verify that this is the same as ignoring all +- tests of HP2. */ +- HEADER *hp2 = answerp2 ? (HEADER *) *answerp2 : hp; +- +- if (n < (int) sizeof (HEADER) && answerp2 != NULL +- && *resplen2 > (int) sizeof (HEADER)) ++ /* We simplify the following tests by assigning HP to HP2 or ++ vice versa. It is easy to verify that this is the same as ++ ignoring all tests of HP or HP2. */ ++ if (answerp2 == NULL || *resplen2 < (int) sizeof (HEADER)) + { +- /* Special case of partial answer. */ +- assert (hp != hp2); +- hp = hp2; ++ hp2 = hp; + } +- else if (answerp2 != NULL && *resplen2 < (int) sizeof (HEADER) +- && n > (int) sizeof (HEADER)) ++ else + { +- /* Special case of partial answer. */ +- assert (hp != hp2); +- hp2 = hp; ++ hp2 = (HEADER *) *answerp2; ++ if (n < (int) sizeof (HEADER)) ++ { ++ hp = hp2; ++ } + } + ++ /* Make sure both hp and hp2 are defined */ ++ assert((hp != NULL) && (hp2 != NULL)); ++ + if ((hp->rcode != NOERROR || ntohs(hp->ancount) == 0) + && (hp2->rcode != NOERROR || ntohs(hp2->ancount) == 0)) { + #ifdef DEBUG -- http://linuxfromscratch.org/mailman/listinfo/patches FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
