From b5568386c2a16a56a5b290a4e6f498229d7e695f Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Tue, 29 Apr 2008 13:33:09 +0300 Subject: Avoid alloca() in headerLoad() - REGION_TAG_COUNT is a constant so local array would do even without C99.. --- rpmdb/header.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)) -- cgit v1.2.3