From 94f325a82f5e7a50350c0be8b95538ad0d24e1d1 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Thu, 27 Jan 2022 11:47:28 -0500 Subject: Fix inverted logic in base2bin() headerGet() returning 0 is an error condition. (cherry picked from commit 619ef3edc5b7958184954a513b3f5cbe22aee5f2) --- lib/rpmfi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rpmfi.c b/lib/rpmfi.c index d36263248..33b657aa2 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1599,7 +1599,7 @@ static uint8_t *base2bin(Header h, rpmTagVal tag, rpm_count_t num, int *len) size_t *lengths = xcalloc(num, sizeof(size_t)); const char *s; - if (headerGet(h, tag, &td, HEADERGET_MINMEM) && rpmtdCount(&td) != num) + if (!headerGet(h, tag, &td, HEADERGET_MINMEM) || rpmtdCount(&td) != num) goto out; while ((s = rpmtdNextString(&td))) { -- cgit v1.2.1