aboutsummaryrefslogtreecommitdiffstats
path: root/main/ipsec-tools/04-splitnet-malloc-fix.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-08-23 14:58:18 +0300
committerTimo Teräs <timo.teras@iki.fi>2012-08-23 14:59:26 +0300
commit75708decfc9606471b2f84956c5aedbdc587b5c1 (patch)
tree5758bae5c4e480bbec562b856d5c11ae1e51e7cb /main/ipsec-tools/04-splitnet-malloc-fix.patch
parentc2a9ab90408365e4d68c3bfe3350a09fd908881a (diff)
downloadaports-75708decfc9606471b2f84956c5aedbdc587b5c1.tar.bz2
aports-75708decfc9606471b2f84956c5aedbdc587b5c1.tar.xz
main/ipsec-tools: cherry-pick fixes from upstream CVS
Diffstat (limited to 'main/ipsec-tools/04-splitnet-malloc-fix.patch')
-rw-r--r--main/ipsec-tools/04-splitnet-malloc-fix.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/main/ipsec-tools/04-splitnet-malloc-fix.patch b/main/ipsec-tools/04-splitnet-malloc-fix.patch
new file mode 100644
index 0000000000..5f7aa8b90a
--- /dev/null
+++ b/main/ipsec-tools/04-splitnet-malloc-fix.patch
@@ -0,0 +1,36 @@
+Please note that diffs are not public domain; they are subject to the
+copyright notices on the relevant files.
+
+===================================================================
+RCS file: /ftp/cvs/cvsroot/src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c,v
+retrieving revision 1.9
+retrieving revision 1.9.18.1
+diff -u -p -r1.9 -r1.9.18.1
+--- ipsec-tools/src/racoon/isakmp_unity.c 2007/10/19 03:37:19 1.9
++++ ipsec-tools/src/racoon/isakmp_unity.c 2012/01/01 17:32:04 1.9.18.1
+@@ -1,4 +1,4 @@
+-/* $NetBSD: isakmp_unity.c,v 1.9 2007/10/19 03:37:19 manu Exp $ */
++/* $NetBSD: isakmp_unity.c,v 1.9.18.1 2012/01/01 17:32:04 tteras Exp $ */
+
+ /* Id: isakmp_unity.c,v 1.10 2006/07/31 04:49:23 manubsd Exp */
+
+@@ -387,8 +387,9 @@ char * splitnet_list_2str(list, splitnet
+ netentry = netentry->next;
+ }
+
+- /* allocate network list string */
+- str = racoon_malloc(len);
++ /* allocate network list string; we need the extra byte temporarily
++ * as sprintf() will write trailing 0-byte after the space. */
++ str = racoon_malloc(len + 1);
+ if (str == NULL)
+ return NULL;
+
+@@ -414,6 +415,7 @@ char * splitnet_list_2str(list, splitnet
+ netentry = netentry->next;
+ }
+
++ /* trim the string to not have trailing spaces */
+ str[len-1]=0;
+
+ return str;