Skip to content

Commit

Permalink
Fix reading rpmtd behind its size in formatValue() (rhbz:1316896)
Browse files Browse the repository at this point in the history
When it is read from index higher than size of rpmtd, return "(none)".
  • Loading branch information
Lubos Kardos committed Apr 25, 2016
1 parent eb632e5 commit b722cf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/headerfmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ static char * formatValue(headerSprintfArgs hsa, sprintfTag tag, int element)
char * t, * te;
rpmtd td;

if ((td = getData(hsa, tag->tag))) {
if ((td = getData(hsa, tag->tag)) && td->count > element) {
td->ix = element; /* Ick, use iterators instead */
val = tag->fmt(td);
} else {
Expand Down

0 comments on commit b722cf8

Please sign in to comment.