diff options
author | Demi Marie Obenour <demi@invisiblethingslab.com> | 2022-01-27 11:47:28 -0500 |
---|---|---|
committer | Michal Domonkos <mdomonko@redhat.com> | 2022-07-01 10:52:14 +0200 |
commit | 94f325a82f5e7a50350c0be8b95538ad0d24e1d1 (patch) | |
tree | fdf8767b6e6dfa41df88360ef840b1bc1f0a914d | |
parent | 1123568f463c999bdafb6f97dc7d82a4d247da94 (diff) | |
download | rpm-94f325a82f5e7a50350c0be8b95538ad0d24e1d1.tar.gz |
Fix inverted logic in base2bin()
headerGet() returning 0 is an error condition.
(cherry picked from commit 619ef3edc5b7958184954a513b3f5cbe22aee5f2)
-rw-r--r-- | lib/rpmfi.c | 2 |
1 files changed, 1 insertions, 1 deletions
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))) { |