Fix "pkg_version -Io" coredump, if some packages have no origin at

all.

PR:		bin/101932
Submitted by:	novel, sat
MFC after:	5 days
This commit is contained in:
krion 2006-08-12 18:32:51 +00:00
parent 540d9c9aaa
commit 2262442192

View File

@ -259,7 +259,7 @@ show_version(Package plist, const char *latest, const char *source)
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);