Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Don't crash if PUBKEY is not set when using SIGNATURE_TYPE:PUBKEY
Bryan Drewery committed 11 years ago
commit 2a800cdaf0d5449c8f125df0e739939a19a1504b
parent 9a24cd3
1 file changed +6 -0
modified libpkg/pkg_repo.c
@@ -648,6 +648,12 @@ pkg_repo_archive_extract_check_archive(int fd, const char *file,
		return (EPKG_FATAL);

	if (pkg_repo_signature_type(repo) == SIG_PUBKEY) {
+
		if (pkg_repo_key(repo) == NULL) {
+
			pkg_emit_error("No PUBKEY defined. Removing "
+
			    "repository.");
+
			rc = EPKG_FATAL;
+
			goto cleanup;
+
		}
		if (sc == NULL) {
			pkg_emit_error("No signature found in the repository.  "
					"Can not validate against %s key.", pkg_repo_key(repo));