Module Name:    src
Committed By:   tteras
Date:           Sun Jan  1 17:31:42 UTC 2012

Modified Files:
        src/crypto/dist/ipsec-tools/src/racoon: isakmp_unity.c

Log Message:
>From Rainer Weikusat <rweiku...@mobileactivedefense.com>: Fix one byte too
short memory allocation in isakmp_unity.c:splitnet_list_2str().


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
    src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c:1.9 src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c:1.10
--- src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c:1.9	Fri Oct 19 03:37:19 2007
+++ src/crypto/dist/ipsec-tools/src/racoon/isakmp_unity.c	Sun Jan  1 17:31:42 2012
@@ -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.10 2012/01/01 17:31:42 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;

Reply via email to