PERFORCE change 82899 for review

soc-andrew soc-andrew at FreeBSD.org
Wed Aug 31 13:41:20 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=82899

Change 82899 by soc-andrew at soc-andrew_serv on 2005/08/31 13:40:39

	Fix a seg fault when installing under certain conditions

Affected files ...

.. //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/fn_install_freebsd.c#10 edit

Differences ...

==== //depot/projects/soc2005/bsdinstaller/src/usr.sbin/bsdinstaller/backend/fn_install_freebsd.c#10 (text+ko) ====

@@ -204,7 +204,7 @@
 	char base[PATH_MAX];
 	/* This should be big enough as the largest dist name is ~9 */
 	char dist_name[32];
-	void *rk;
+	char *rk;
 	size_t rk_len;
 	int i;
 	struct commands *cmds;
@@ -228,9 +228,10 @@
 	while (!aura_dict_eof(a->dists)) {
 		/* Set dist_name */
 		aura_dict_get_current_key(a->dists, &rk, &rk_len);
+		if (rk_len < 32)
+			rk[rk_len] = '\0';
+
 		strlcpy(dist_name, rk, 32);
-		if (rk_len < 32)
-			dist_name[rk_len] = '\0';
 
 		/* If this dist is special set the correct flag */
 		if (strncmp("src", dist_name, 4) == 0) {


More information about the p4-projects mailing list