summaryrefslogtreecommitdiff
path: root/testing/libtirpc/libtirpc-0.2.1-fortify.patch
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-07-24 00:03:37 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-07-24 00:03:37 -0500
commit070c331922151d301e3147728cae638902b61db9 (patch)
tree72e112fe8edc90e296f318b0603f3288369f43a9 /testing/libtirpc/libtirpc-0.2.1-fortify.patch
parent0d18015803bebeb58911bf791653597291056095 (diff)
parent0e8166d926f929f470d01d5bc8c8823e094742da (diff)
Commiting libre package llvm-2.9-6
Diffstat (limited to 'testing/libtirpc/libtirpc-0.2.1-fortify.patch')
-rw-r--r--testing/libtirpc/libtirpc-0.2.1-fortify.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/libtirpc/libtirpc-0.2.1-fortify.patch b/testing/libtirpc/libtirpc-0.2.1-fortify.patch
new file mode 100644
index 000000000..7375bf83e
--- /dev/null
+++ b/testing/libtirpc/libtirpc-0.2.1-fortify.patch
@@ -0,0 +1,18 @@
+Index: libtirpc-0.2.1/src/getrpcport.c
+===================================================================
+--- libtirpc-0.2.1.orig/src/getrpcport.c
++++ libtirpc-0.2.1/src/getrpcport.c
+@@ -54,11 +54,11 @@ getrpcport(host, prognum, versnum, proto
+
+ if ((hp = gethostbyname(host)) == NULL)
+ return (0);
++ if (hp->h_length != sizeof(addr.sin_addr.s_addr))
++ return (0);
+ memset(&addr, 0, sizeof(addr));
+ addr.sin_family = AF_INET;
+ addr.sin_port = 0;
+- if (hp->h_length > sizeof(addr))
+- hp->h_length = sizeof(addr);
+ memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
+ /* Inconsistent interfaces need casts! :-( */
+ return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum,