- Fix crash when no PACKAGESITE is defined in pkg.conf

Approved by:	bapt (mentor, maintainer)
This commit is contained in:
Bryan Drewery 2012-08-23 22:09:53 +00:00
parent 780c634d26
commit e73d68fc73
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=303041
2 changed files with 12 additions and 0 deletions

View file

@ -7,6 +7,7 @@
PORTNAME= pkg
DISTVERSION= 1.0-rc6
PORTREVISION= 1
CATEGORIES= ports-mgmt
MASTER_SITES= LOCAL/portmgr \
http://files.etoilebsd.net/pkg/

View file

@ -0,0 +1,11 @@
--- libpkg/pkg_config.c
+++ libpkg/pkg_config.c
@@ -268,7 +268,7 @@ subst_packagesite(void)
oldval = c[PKG_CONFIG_REPO].val;
- if ((variable_string = strstr(oldval, ABI_VAR_STRING)) == NULL)
+ if (oldval == NULL || (variable_string = strstr(oldval, ABI_VAR_STRING)) == NULL)
return;
newval = sbuf_new_auto();