summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-29 13:33:09 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-29 13:33:09 +0300
commitb5568386c2a16a56a5b290a4e6f498229d7e695f (patch)
tree53c4e09403631b6f67a5388c42f3a114962ddce9
parent3be356cb0f583c68069150421a7bdd5a8f65d555 (diff)
downloadrpm-b5568386c2a16a56a5b290a4e6f498229d7e695f.tar.gz
rpm-b5568386c2a16a56a5b290a4e6f498229d7e695f.tar.bz2
rpm-b5568386c2a16a56a5b290a4e6f498229d7e695f.zip
Avoid alloca() in headerLoad()
- REGION_TAG_COUNT is a constant so local array would do even without C99..
-rw-r--r--rpmdb/header.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/rpmdb/header.c b/rpmdb/header.c
index 66e12044f..1639c4313 100644
--- a/rpmdb/header.c
+++ b/rpmdb/header.c
@@ -881,7 +881,9 @@ Header headerLoad(void * uh)
goto errxit;
if (off) {
size_t nb = REGION_TAG_COUNT;
- int32_t * stei = memcpy(alloca(nb), dataStart + off, nb);
+ int32_t stei[nb];
+ /* XXX Hmm, why the copy? */
+ memcpy(&stei, dataStart + off, nb);
rdl = -ntohl(stei[2]); /* negative offset */
ril = rdl/sizeof(*pe);
if (hdrchkTags(ril) || hdrchkData(rdl))