From 80ab4ab3f6f6853736f47ee7214a9fbd24f9510b Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 30 Oct 2007 12:25:15 +0200 Subject: [PATCH] Avoid rpmte internals access in rpmtsNotify() --- lib/rpmts.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rpmts.c b/lib/rpmts.c index e794a047b..c297b42d3 100644 --- a/lib/rpmts.c +++ b/lib/rpmts.c @@ -16,7 +16,6 @@ #include "rpmlock.h" #include "rpmerr.h" -#define _RPMTE_INTERNAL /* XXX te->h */ #include "rpmte.h" #define _RPMTS_INTERNAL @@ -1418,11 +1417,13 @@ void * rpmtsNotify(rpmts ts, rpmte te, { void * ptr = NULL; if (ts && ts->notify && te) { -assert(!(te->type == TR_ADDED && te->h == NULL)); + Header h = rpmteHeader(te); +assert(!(rpmteType(te) == TR_ADDED && h == NULL)); /* FIX: cast? */ /* FIX: check rc */ - ptr = ts->notify(te->h, what, amount, total, + ptr = ts->notify(h, what, amount, total, rpmteKey(te), ts->notifyData); + headerUnlink(h); /* undo rpmteHeader() ref */ } return ptr; }