forked from pool/glibc
Accepting request 82412 from home:michal-m:branches:Base:System
- Fix assertion error in res_query.c, triggered by Firefox (bso#13013). OBS-URL: https://build.opensuse.org/request/show/82412 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=105
This commit is contained in:
parent
5b71ae72e0
commit
89c17cfdd5
59
glibc-resolv-assert.diff
Normal file
59
glibc-resolv-assert.diff
Normal file
@ -0,0 +1,59 @@
|
||||
2011-07-21 Aurelien Jarno <aurel32@debian.org>
|
||||
|
||||
* resolv/res_query.c(__libc_res_nquery): Assign hp and hp2
|
||||
depending n and resplen2 to catch cases where answer
|
||||
equals answerp2.
|
||||
|
||||
diff --git a/resolv/res_query.c b/resolv/res_query.c
|
||||
index 2f7cfaa..405fa68 100644
|
||||
--- 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
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 16 11:20:29 UTC 2011 - mmarek@suse.cz
|
||||
|
||||
- Fix assertion error in res_query.c, triggered by Firefox
|
||||
(bso#13013).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 7 07:17:16 UTC 2011 - aj@suse.de
|
||||
|
||||
|
@ -206,6 +206,8 @@ Patch70: glibc-2.15-vsyscall.patch
|
||||
Patch71: x86-cpuid-level2.patch
|
||||
# PATCH-FIX-UPSTREAM Avoid use of vsyscall aj@suse.de
|
||||
Patch72: glibc-2.15-avoid-vsyscall.patch
|
||||
# PATCH-FIX-UPSTREAM Fix assertion error in res_query.c (bso#13013)
|
||||
Patch73: glibc-resolv-assert.diff
|
||||
# PATCH-FEATURE-OPENSUSE -- add sha support to crypt_blowfish lnussel@suse.de
|
||||
Patch80: crypt_blowfish-1.2-sha.diff
|
||||
# PATCH-FEATURE-OPENSUSE -- use separate symbol version for Owl extensions - lnussel@suse.de
|
||||
@ -323,7 +325,6 @@ library.
|
||||
|
||||
%package devel-static
|
||||
|
||||
|
||||
Summary: C library static libraries for -static linking
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{name}-devel = %{version}
|
||||
@ -444,6 +445,7 @@ rm nscd/s-stamp
|
||||
%patch70 -p1
|
||||
%patch71 -p1
|
||||
%patch72 -p1
|
||||
%patch73 -p1
|
||||
|
||||
#
|
||||
# Inconsistency detected by ld.so: dl-close.c: 719: _dl_close: Assertion `map->l_init_called' failed!
|
||||
|
Loading…
Reference in New Issue
Block a user