diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-05-06 21:39:39 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-05-06 21:39:39 -0400 |
commit | 38dbfc58450f5064f8534435ccc7b4c005bbfa68 (patch) | |
tree | 829e9c277a024cf520db2b7bfaf7d5cb4fe5ba45 /cross/cross-mips64el-unknown-linux-gnu-glibc-headers/glibc-2.15-fix-res_query-assert.patch | |
parent | e1f7b97ab1603aea664ee3f392f6263fd7812b3c (diff) | |
parent | d48da3adb2e5eaab66403aa3f0fce2d78f3ecd12 (diff) | |
download | abslibre-38dbfc58450f5064f8534435ccc7b4c005bbfa68.tar.gz abslibre-38dbfc58450f5064f8534435ccc7b4c005bbfa68.tar.bz2 abslibre-38dbfc58450f5064f8534435ccc7b4c005bbfa68.zip |
Merge branch 'master' of ssh://parabolagnulinux.org:1863/srv/git/abslibre
Diffstat (limited to 'cross/cross-mips64el-unknown-linux-gnu-glibc-headers/glibc-2.15-fix-res_query-assert.patch')
-rw-r--r-- | cross/cross-mips64el-unknown-linux-gnu-glibc-headers/glibc-2.15-fix-res_query-assert.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/cross/cross-mips64el-unknown-linux-gnu-glibc-headers/glibc-2.15-fix-res_query-assert.patch b/cross/cross-mips64el-unknown-linux-gnu-glibc-headers/glibc-2.15-fix-res_query-assert.patch new file mode 100644 index 000000000..a894da9c7 --- /dev/null +++ b/cross/cross-mips64el-unknown-linux-gnu-glibc-headers/glibc-2.15-fix-res_query-assert.patch @@ -0,0 +1,51 @@ +--- 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 |