Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix pkg audit -F after -4/-6 merge
Bryan Drewery committed 11 years ago
commit 0329713248cfcb838fc5684da31e33e169626128
parent d7e9e4f
1 file changed +8 -4
modified libpkg/fetch.c
@@ -559,10 +559,14 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, time_t *t
 
		fetchOpts = sbuf_new_auto();
		sbuf_cat(fetchOpts, "i");
-
		if ((repo->flags & REPO_FLAGS_USE_IPV4) == REPO_FLAGS_USE_IPV4)
-
			sbuf_cat(fetchOpts, "4");
-
		else if ((repo->flags & REPO_FLAGS_USE_IPV6) == REPO_FLAGS_USE_IPV6)
-
			sbuf_cat(fetchOpts, "6");
+
		if (repo != NULL) {
+
			if ((repo->flags & REPO_FLAGS_USE_IPV4) ==
+
			    REPO_FLAGS_USE_IPV4)
+
				sbuf_cat(fetchOpts, "4");
+
			else if ((repo->flags & REPO_FLAGS_USE_IPV6) ==
+
			    REPO_FLAGS_USE_IPV6)
+
				sbuf_cat(fetchOpts, "6");
+
		}

		pkg_debug(1,"Fetch: fetching from: %s://%s%s%s%s with opts \"%s\"",
		    u->scheme,