Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Apr 2010 13:38:02 GMT
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 176834 for review
Message-ID:  <201004121338.o3CDc2Rr045876@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@176834?ac=10

Change 176834 by gcooper@gcooper-bayonetta on 2010/04/12 13:37:24

	Avoid a potential segfault because of uninitialized data.

Affected files ...

.. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/lib/file.c#12 edit

Differences ...

==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/lib/file.c#12 (text+ko) ====

@@ -377,8 +377,14 @@
 	/* int fd = -1; */
 	int r;
 
+	if (pkg == NULL || strcmp(pkg, "-") == 0)
+		pkg_name_humanized = "(stdin)";
+	else
+		pkg_name_humanized = pkg;
+
 	if (Verbose)
-		printf("%s: will extract %s from %s\n", __func__, file, pkg);
+		printf("%s: will extract %s from %s\n",
+		    __func__, file, pkg_name_humanized);
 
 	archive = archive_read_new();
 	archive_read_support_compression_all(archive);



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