aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-29 18:48:57 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-02-29 18:48:57 +0000
commit5aea0b6d8eaa1c58ca935154e9bb8d0147ff6d96 (patch)
tree9b389f57531086ad827c0975605a7ba77af62bd0
parentcb34d0e6c01c51d168be1d04868ab5737b30cd0f (diff)
downloadrpmtools-5aea0b6d8eaa1c58ca935154e9bb8d0147ff6d96.tar
rpmtools-5aea0b6d8eaa1c58ca935154e9bb8d0147ff6d96.tar.gz
rpmtools-5aea0b6d8eaa1c58ca935154e9bb8d0147ff6d96.tar.bz2
rpmtools-5aea0b6d8eaa1c58ca935154e9bb8d0147ff6d96.tar.xz
rpmtools-5aea0b6d8eaa1c58ca935154e9bb8d0147ff6d96.zip
always initialize pointer in headerGetEntry
-rw-r--r--rpm5compat.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/rpm5compat.h b/rpm5compat.h
index 5c2da10..860cc8d 100644
--- a/rpm5compat.h
+++ b/rpm5compat.h
@@ -58,7 +58,8 @@ 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;
+ /* Always ensure to initialize */
+ *(void **)p = NULL;
he->tag = tag;
rc = headerGet(h, he, tag);
if (rc) {
@@ -66,6 +67,7 @@ static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void ** p, h
if (p) *(void **) p = he->p.ptr;
if (c) *c = he->c;
}
+
return rc;
}