]> git.pld-linux.org Git - packages/rpm.git/blame - rpm-reduce-stack-usage.patch
- updated for 4.4.8
[packages/rpm.git] / rpm-reduce-stack-usage.patch
CommitLineData
f98b7ee5
JB
1--- rpm-4.4.8/rpmio/macro.c.orig 2007-01-21 21:37:58.000000000 +0100
2+++ rpm-4.4.8/rpmio/macro.c 2007-04-08 19:50:49.214644921 +0200
3@@ -942,7 +942,8 @@
0cf7650c
PS
4 /*@globals rpmGlobalMacroContext @*/
5 /*@modifies mb, rpmGlobalMacroContext @*/
6 {
7- char buf[BUFSIZ], *b, *be;
8+ static char buf[BUFSIZ];
9+ char *b, *be;
10 char aname[16];
11 const char *opts, *o;
12 int argc = 0;
f98b7ee5 13@@ -1850,7 +1851,7 @@
0cf7650c
PS
14 return 0;
15 if (mc == NULL) mc = rpmGlobalMacroContext;
16
17- tbuf = alloca(slen + 1);
18+ tbuf = xmalloc(slen + 1);
19 memset(tbuf, 0, (slen + 1));
20
21 mb->s = sbuf;
f98b7ee5
JB
22@@ -1870,6 +1871,7 @@
23 rpmError(RPMERR_BADSPEC, _("Macro expansion too big for target buffer\n"));
24 else
25 strncpy(sbuf, tbuf, (slen - mb->nb + 1));
0cf7650c
PS
26+ free(tbuf);
27
28 return rc;
29 }
f98b7ee5 30@@ -2308,7 +2310,7 @@
0cf7650c
PS
31 const char *
32 rpmGetPath(const char *path, ...)
33 {
34- char buf[BUFSIZ];
35+ static char buf[BUFSIZ];
36 const char * s;
37 char * t, * te;
38 va_list ap;
This page took 0.087235 seconds and 4 git commands to generate.