mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Check value at resplen2 if it is not NULL
There was a typo in the previous patch due to which resplen2 was checked for non-zero instead of the value at resplen2. Fix that and improve the condition by checking resplen2 for non-NULL (instead of answerp2) and also adding the check in a third place.
This commit is contained in:
@ -1,5 +1,8 @@
|
|||||||
2014-07-08 Siddhesh Poyarekar <siddhesh@redhat.com>
|
2014-07-08 Siddhesh Poyarekar <siddhesh@redhat.com>
|
||||||
|
|
||||||
|
* resolv/res_query.c (__libc_res_nsearch): Dereference resplen2
|
||||||
|
after checking that it is non-NULL.
|
||||||
|
|
||||||
* sysdeps/i386/dl-machine.h: Define ELF_MACHINE_NO_REL.
|
* sysdeps/i386/dl-machine.h: Define ELF_MACHINE_NO_REL.
|
||||||
|
|
||||||
2014-07-08 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
2014-07-08 Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
||||||
|
@ -384,7 +384,7 @@ __libc_res_nsearch(res_state statp,
|
|||||||
answerp2_malloced);
|
answerp2_malloced);
|
||||||
if (ret > 0 || trailing_dot
|
if (ret > 0 || trailing_dot
|
||||||
/* If the second response is valid then we use that. */
|
/* If the second response is valid then we use that. */
|
||||||
|| (ret == 0 && answerp2 != NULL && resplen2 > 0))
|
|| (ret == 0 && resplen2 != NULL && *resplen2 > 0))
|
||||||
return (ret);
|
return (ret);
|
||||||
saved_herrno = h_errno;
|
saved_herrno = h_errno;
|
||||||
tried_as_is++;
|
tried_as_is++;
|
||||||
@ -424,8 +424,8 @@ __libc_res_nsearch(res_state statp,
|
|||||||
answer, anslen, answerp,
|
answer, anslen, answerp,
|
||||||
answerp2, nanswerp2,
|
answerp2, nanswerp2,
|
||||||
resplen2, answerp2_malloced);
|
resplen2, answerp2_malloced);
|
||||||
if (ret > 0 || (ret == 0 && answerp2 != NULL
|
if (ret > 0 || (ret == 0 && resplen2 != NULL
|
||||||
&& resplen2 > 0))
|
&& *resplen2 > 0))
|
||||||
return (ret);
|
return (ret);
|
||||||
|
|
||||||
if (answerp && *answerp != answer) {
|
if (answerp && *answerp != answer) {
|
||||||
@ -494,7 +494,8 @@ __libc_res_nsearch(res_state statp,
|
|||||||
answer, anslen, answerp,
|
answer, anslen, answerp,
|
||||||
answerp2, nanswerp2, resplen2,
|
answerp2, nanswerp2, resplen2,
|
||||||
answerp2_malloced);
|
answerp2_malloced);
|
||||||
if (ret > 0)
|
if (ret > 0 || (ret == 0 && resplen2 != NULL
|
||||||
|
&& *resplen2 > 0))
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user