changeset 10625:76705885a9bb

6884160 snoop can catch signal 11 in verbose AH processing
author Paul Wernau <Paul.Wernau@Sun.COM>
date Wed, 23 Sep 2009 18:26:43 -0400
parents 5ccd6d7aa2d9
children 9c09f5dd637e
files usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ipsec.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ipsec.c	Wed Sep 23 12:21:55 2009 -0400
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ipsec.c	Wed Sep 23 18:26:43 2009 -0400
@@ -19,12 +19,10 @@
  * CDDL HEADER END
  */
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
@@ -164,8 +162,11 @@
 		(void) sprintf(get_line((char *)&ah->ah_replay - dlc_header, 4),
 		    "Replay = %u", ntohl(aligned_ah->ah_replay));
 
-		/* * 2 for two hex digits per auth_data byte. */
-		buff = malloc(auth_data_len * 2);
+		/*
+		 * 2 for two hex digits per auth_data byte
+		 * plus one byte for trailing null byte.
+		 */
+		buff = malloc(auth_data_len * 2 + 1);
 		if (buff != NULL) {
 			int i;