Skip to content

Commit b722cf8

Browse files
author
Lubos Kardos
committed
Fix reading rpmtd behind its size in formatValue() (rhbz:1316896)
When it is read from index higher than size of rpmtd, return "(none)".
1 parent eb632e5 commit b722cf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/headerfmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element)
623623
char * t, * te;
624624
rpmtd td;
625625

626-
if ((td = getData(hsa, tag->tag))) {
626+
if ((td = getData(hsa, tag->tag)) && td->count > element) {
627627
td->ix = element; /* Ick, use iterators instead */
628628
val = tag->fmt(td);
629629
} else {

0 commit comments

Comments
 (0)