rpm/rpm-5.4.7-hdrfmt-fix-unitialized-argv-element.patch

15 lines
591 B
Diff
Raw Normal View History

2012-08-01 14:59:23 +04:00
--- rpm-5.4.7/rpmdb/hdrfmt.c.unitialized~ 2012-03-19 14:21:14.907225418 +0100
+++ rpm-5.4.7/rpmdb/hdrfmt.c 2012-03-19 14:21:17.327228582 +0100
@@ -2048,8 +2048,10 @@ static int triggertypeTag(Header h, HE_t
he->p.argv = xmalloc(sizeof(*he->p.argv) * he->c);
for (i = 0; i < (unsigned) he->c; i++) {
for (j = 0; j < (unsigned) numNames; j++) {
- if (indices.ui32p[j] != i)
+ if (indices.ui32p[j] != i) {
+ he->p.argv[i] = NULL;
/*@innercontinue@*/ continue;
+ }
/* XXX FIXME: there's memory leaks here. */
if (flags.ui32p[j] & RPMSENSE_TRIGGERPREIN)