diff options
Diffstat (limited to 'rpmio/macro.c')
-rw-r--r-- | rpmio/macro.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c index 6dc173f17..b5363ef00 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1111,10 +1111,11 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn, /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies mb, rpmGlobalMacroContext, fileSystem, internalState @*/ { - char buf[BUFSIZ], *b = NULL, *be; + char *buf, *b = NULL, *be; int c; - buf[0] = '\0'; + buf = alloca(gn + 1); + memset(buf, 0, gn + 1); if (g != NULL) { strncpy(buf, g, gn); buf[gn] = '\0'; |