Blame SOURCES/shadow-4.1.5.1-merge-group.patch

9f90df
diff -up shadow-4.1.5.1/lib/groupio.c.merge-group shadow-4.1.5.1/lib/groupio.c
9f90df
--- shadow-4.1.5.1/lib/groupio.c.merge-group	2011-02-16 21:32:24.000000000 +0100
9f90df
+++ shadow-4.1.5.1/lib/groupio.c	2013-01-29 13:56:43.049275513 +0100
9f90df
@@ -330,12 +330,12 @@ static /*@null@*/struct commonio_entry *
9f90df
 
9f90df
 	/* Concatenate the 2 lines */
9f90df
 	new_line_len = strlen (gr1->line) + strlen (gr2->line) +1;
9f90df
-	new_line = (char *)malloc ((new_line_len + 1) * sizeof(char*));
9f90df
+	new_line = (char *)malloc (new_line_len + 1);
9f90df
 	if (NULL == new_line) {
9f90df
 		errno = ENOMEM;
9f90df
 		return NULL;
9f90df
 	}
9f90df
-	snprintf(new_line, new_line_len, "%s\n%s", gr1->line, gr2->line);
9f90df
+	snprintf(new_line, new_line_len + 1, "%s\n%s", gr1->line, gr2->line);
9f90df
 	new_line[new_line_len] = '\0';
9f90df
 
9f90df
 	/* Concatenate the 2 list of members */
9f90df
@@ -353,7 +353,7 @@ static /*@null@*/struct commonio_entry *
9f90df
 			members++;
9f90df
 		}
9f90df
 	}
9f90df
-	new_members = (char **)malloc ( (members+1) * sizeof(char*) );
9f90df
+	new_members = (char **)calloc (members+1, sizeof(char*));
9f90df
 	if (NULL == new_members) {
9f90df
 		free (new_line);
9f90df
 		errno = ENOMEM;