svn commit: r369194 - in head/ports-mgmt/pkg: . files
Bryan Drewery
bdrewery at FreeBSD.org
Wed Sep 24 18:35:28 UTC 2014
Author: bdrewery
Date: Wed Sep 24 18:35:27 2014
New Revision: 369194
URL: http://svnweb.freebsd.org/changeset/ports/369194
QAT: https://qat.redports.org/buildarchive/r369194/
Log:
- Fix crash when overriding repo configs.
PR: 193890
Reported by: Nikolai Lifanov
With hat: portmgr
Pointyhat to: bdrewery
Added:
head/ports-mgmt/pkg/files/patch-libpkg__pkg_config.c (contents, props changed)
Modified:
head/ports-mgmt/pkg/Makefile
Modified: head/ports-mgmt/pkg/Makefile
==============================================================================
--- head/ports-mgmt/pkg/Makefile Wed Sep 24 18:12:39 2014 (r369193)
+++ head/ports-mgmt/pkg/Makefile Wed Sep 24 18:35:27 2014 (r369194)
@@ -2,6 +2,7 @@
PORTNAME= pkg
DISTVERSION= 1.3.8
+PORTREVISION= 1
_PKG_VERSION= ${DISTVERSION}
CATEGORIES= ports-mgmt
MASTER_SITES= \
Added: head/ports-mgmt/pkg/files/patch-libpkg__pkg_config.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/ports-mgmt/pkg/files/patch-libpkg__pkg_config.c Wed Sep 24 18:35:27 2014 (r369194)
@@ -0,0 +1,28 @@
+commit 67751707406b7da5ff85978f755d4e68bab3d38d
+Author: Bryan Drewery <bryan at shatow.net>
+Date: Wed Sep 24 13:30:29 2014 -0500
+
+ Fix repo override crashing when URL is not defined.
+
+ Only override URL if one is provided.
+
+ Issue: #1024
+
+diff --git libpkg/pkg_config.c libpkg/pkg_config.c
+index ec96883..83e2f5d 100644
+--- libpkg/pkg_config.c
++++ libpkg/pkg_config.c
+@@ -1065,9 +1065,11 @@ pkg_repo_overwrite(struct pkg_repo *r, const char *name, const char *url,
+ {
+
+ free(r->name);
+- free(r->url);
+ r->name = strdup(name);
+- r->url = strdup(url);
++ if (url != NULL) {
++ free(r->url);
++ r->url = strdup(url);
++ }
+ r->ops = pkg_repo_find_type(type);
+ HASH_DEL(repos, r);
+ HASH_ADD_KEYPTR(hh, repos, r->name, strlen(r->name), r);
More information about the svn-ports-all
mailing list