Permalink
Browse files

Fix reading rpmtd behind its size in formatValue() (rhbz:1316896)

When it is read from index higher than size of rpmtd, return "(none)".
  • Loading branch information...
lkardos committed Apr 25, 2016
1 parent eb632e5 commit b722cf86200505b3e3fcbb2095c4ff61f1f5a2ab
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/headerfmt.c
View
@@ -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 {

0 comments on commit b722cf8

Please sign in to comment.