Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Aug 2005 13:41:18 GMT
From:      soc-andrew <soc-andrew@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 82899 for review
Message-ID:  <200508311341.j7VDfI6o094323@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help

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

Change 82899 by soc-andrew@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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200508311341.j7VDfI6o094323>