From 4b03c52821c38cace41847d4a6754ceceb35fa7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=98yvind=20Karlsen?= Date: Fri, 29 Feb 2008 14:29:41 +0000 Subject: be sure to set return value to NULL in headerGetEntry when Epoch isn't set --- rpm5compat.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/rpm5compat.h b/rpm5compat.h index 4dc06c5..2a49264 100644 --- a/rpm5compat.h +++ b/rpm5compat.h @@ -22,14 +22,15 @@ enum hMagic { }; -typedef uint32_t * hTAG_t; -typedef uint32_t * hTYP_t; -typedef const void * hPTR_t; -typedef uint32_t * hCNT_t; -typedef uint32_t int_32; -typedef uint16_t uint_16; -typedef uint8_t byte; -typedef union hRET_s { +typedef uint32_t * hTAG_t; +typedef uint32_t * hTYP_t; +typedef const void * hPTR_t; +typedef uint32_t * hCNT_t; +typedef uint32_t int_32; +typedef uint16_t uint_16; +typedef uint8_t byte; + +typedef union hRET_s { const void * ptr; const char ** argv; const char * str; @@ -44,6 +45,7 @@ static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, h HE_t he = memset(alloca(sizeof(*he)), 0, sizeof(*he)); int rc; + if (tag == RPMTAG_EPOCH) *(void **)p = NULL; he->tag = tag; rc = headerGet(h, he, tag); if (rc) { -- cgit v1.2.1