summaryrefslogtreecommitdiff
path: root/cross/mips64el-unknown-linux-gnu-glibc/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-04-17 20:37:01 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-04-17 20:37:01 -0300
commit76480b6b18868754fc95ff41d02885898c54367f (patch)
treeb3c9945f331f2cadd2be8a7dba5b2097c519998f /cross/mips64el-unknown-linux-gnu-glibc/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch
parent7a97ab610eea972771b91f51cb180f0f195b4da3 (diff)
downloadabslibre-76480b6b18868754fc95ff41d02885898c54367f.tar.gz
abslibre-76480b6b18868754fc95ff41d02885898c54367f.tar.bz2
abslibre-76480b6b18868754fc95ff41d02885898c54367f.zip
Updating the cross toolchain for mips64el
Added patches from upstream and diff'ed with them. Binutils and linux-libre-api-headers are already built. GCC Core builts but `mips64el-unknown-linux-gnu-gcc -v dummy.c` fails because of missing -EL on i686-pc-linux-gnu-as. Exporting mips64el-...-binutils to the PATH solves the problem but mips64el-...-ld fails with missing crt*. No idea why target gcc decides to use the host as instead of the target one, since the PKGBUILD hasn't fundamentally changed.
Diffstat (limited to 'cross/mips64el-unknown-linux-gnu-glibc/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch')
-rw-r--r--cross/mips64el-unknown-linux-gnu-glibc/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/cross/mips64el-unknown-linux-gnu-glibc/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch b/cross/mips64el-unknown-linux-gnu-glibc/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch
new file mode 100644
index 000000000..6f0a0398f
--- /dev/null
+++ b/cross/mips64el-unknown-linux-gnu-glibc/glibc-2.15-__libc_res_nquerydomain-out-of-bounds.patch
@@ -0,0 +1,24 @@
+diff --git a/resolv/res_query.c b/resolv/res_query.c
+index 947c651..abccd4a 100644
+--- a/resolv/res_query.c
++++ b/resolv/res_query.c
+@@ -556,12 +556,16 @@ __libc_res_nquerydomain(res_state statp,
+ * copy without '.' if present.
+ */
+ n = strlen(name);
+- if (n >= MAXDNAME) {
++
++ /* Decrement N prior to checking it against MAXDNAME
++ so that we detect a wrap to SIZE_MAX and return
++ a reasonable error. */
++ n--;
++ if (n >= MAXDNAME - 1) {
+ RES_SET_H_ERRNO(statp, NO_RECOVERY);
+ return (-1);
+ }
+- n--;
+- if (n >= 0 && name[n] == '.') {
++ if (name[n] == '.') {
+ strncpy(nbuf, name, n);
+ nbuf[n] = '\0';
+ } else