diff options
-rw-r--r-- | lib/rpmfi.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rpmfi.c b/lib/rpmfi.c index b67680c17..bac5c360e 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -1522,6 +1522,10 @@ static uint8_t *hex2bin(Header h, rpmTagVal tag, rpm_count_t num, size_t len) t += len; continue; } + if (strlen(s) != len * 2) { + bin = rfree(bin); + break; + } for (int j = 0; j < len; j++, t++, s += 2) *t = (rnibble(s[0]) << 4) | rnibble(s[1]); } |