summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubos Kardos <lkardos@redhat.com>2016-04-25 13:31:08 +0200
committerPanu Matilainen <pmatilai@redhat.com>2016-11-02 10:41:53 +0200
commit3cffded66206cad881348c98b16f86e22e6e00da (patch)
treed07e985d3669d9a110026451ca0c2b5f33769d4e
parent1234747a82b7b479bc60b57fd2525c3ce088be7e (diff)
downloadrpm-3cffded66206cad881348c98b16f86e22e6e00da.tar.gz
Fix reading rpmtd behind its size in formatValue() (rhbz:1316896)
When it is read from index higher than size of rpmtd, return "(none)". (cherry picked from commit b722cf86200505b3e3fcbb2095c4ff61f1f5a2ab)
-rw-r--r--lib/headerfmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/headerfmt.c b/lib/headerfmt.c
index 9b3cc723c..546c1400b 100644
--- a/lib/headerfmt.c
+++ b/lib/headerfmt.c
@@ -620,7 +620,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 {