Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Check return from load_fingerprints
Bryan Drewery committed 12 years ago
commit a385cc85a0d94c00f2b5da4b04105960ec823798
parent c36721f
1 file changed +10 -2
modified libpkg/update.c
@@ -357,7 +357,11 @@ repo_archive_extract_file(int fd, const char *file, const char *dest, struct pkg

		/* load fingerprints */
		snprintf(path, MAXPATHLEN, "%s/trusted", pkg_repo_fingerprints(repo));
-
		trusted = load_fingerprints(path);
+
		if ((trusted = load_fingerprints(path)) == NULL) {
+
			pmg_emit_error("Error loading trusted certificates");
+
			rc = EPKG_FATAL;
+
			goto cleanup;
+
		}

		if (HASH_COUNT(trusted) == 0) {
			pkg_emit_error("No trusted certificates");
@@ -366,7 +370,11 @@ repo_archive_extract_file(int fd, const char *file, const char *dest, struct pkg
		}

		snprintf(path, MAXPATHLEN, "%s/revoked", pkg_repo_fingerprints(repo));
-
		revoked = load_fingerprints(path);
+
		if ((revoked = load_fingerprints(path)) == NULL) {
+
			pmg_emit_error("Error loading revoked certificates");
+
			rc = EPKG_FATAL;
+
			goto cleanup;
+
		}

		HASH_ITER(hh, sc, s, stmp) {
			if (s->sig == NULL || s->cert == NULL) {