Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Aug 2006 16:23:10 GMT
From:      Roman Bogorodskiy <novel@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/101932: [pkg_install] fix pkg_version -Io coredump for packages with no ORIGIN
Message-ID:  <200608121623.k7CGNAvE032126@freefall.freebsd.org>
Resent-Message-ID: <200608121630.k7CGUIag032389@freefall.freebsd.org>

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

>Number:         101932
>Category:       bin
>Synopsis:       [pkg_install] fix pkg_version -Io coredump for packages with no ORIGIN
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 12 16:30:17 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Roman Bogorodskiy
>Release:        FreeBSD 6.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD freefall.freebsd.org 6.0-STABLE FreeBSD 6.0-STABLE #0: Sat Dec 10 03:18:20 UTC 2005 kensmith@freefall.freebsd.org:/usr/obj/usr/src/sys/FREEFALL i386


>Description:
	In '-Io' mode pkg_version(1) coredumps if some package has no
	origin because it tries to strlcpy NULL.

	Problem was spotted by sat@ and he provided the simular fix as well.
>How-To-Repeat:
>Fix:

--- pkg_version.diff begins here ---
Index: version/perform.c
===================================================================
RCS file: /home/ncvs/src/usr.sbin/pkg_install/version/perform.c,v
retrieving revision 1.15
diff -u -r1.15 perform.c
--- version/perform.c	12 Feb 2006 16:09:33 -0000	1.15
+++ version/perform.c	12 Aug 2006 16:16:59 -0000
@@ -259,7 +259,7 @@
 
     if (!plist.name || strlen(plist.name) == 0)
 	return;
-    if (ShowOrigin != FALSE)
+    if (ShowOrigin != FALSE && plist.origin != NULL)
 	strlcpy(tmp, plist.origin, PATH_MAX);
     else {
 	strlcpy(tmp, plist.name, PATH_MAX);
--- pkg_version.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



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