From dfe1611bc14d1d8a5800fece174b73d051bb6da0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Sikora?= Date: Wed, 23 Nov 2011 18:31:20 +0000 Subject: [PATCH 1/1] - fix 'res_query.c:251: __libc_res_nquery: Assertion `hp != hp2' failed' failures. Changed files: glibc-pr13013.patch -> 1.1 glibc.spec -> 1.938 --- glibc-pr13013.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++ glibc.spec | 4 +++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 glibc-pr13013.patch diff --git a/glibc-pr13013.patch b/glibc-pr13013.patch new file mode 100644 index 0000000..46893fe --- /dev/null +++ b/glibc-pr13013.patch @@ -0,0 +1,51 @@ +--- a/resolv/res_query.c ++++ b/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 diff --git a/glibc.spec b/glibc.spec index 9d1bcdf..53a206b 100644 --- a/glibc.spec +++ b/glibc.spec @@ -33,7 +33,7 @@ Summary(tr.UTF-8): GNU libc Summary(uk.UTF-8): GNU libc версії Name: glibc Version: 2.14.1 -Release: 2 +Release: 2.1 Epoch: 6 License: LGPL v2.1+ Group: Libraries @@ -86,6 +86,7 @@ Patch38: 1055_all_glibc-resolv-dynamic.patch Patch39: %{name}-git.patch Patch40: %{name}-bad-fix.patch Patch41: %{name}-pr12892.patch +Patch42: %{name}-pr13013.patch URL: http://www.gnu.org/software/libc/ %{?with_selinux:BuildRequires: audit-libs-devel} BuildRequires: autoconf @@ -952,6 +953,7 @@ mv %{name}-ports-%{ports_version} ports %patch40 -p1 # revert broken fix %patch41 -p1 +%patch42 -p1 # cleanup backups after patching find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f -- 2.44.0