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);