]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-reduce-stack-usage.patch
- popt messages come back
[packages/rpm.git] / rpm-reduce-stack-usage.patch
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 @@
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;
13 @@ -1850,7 +1851,7 @@
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;
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));
26 +    free(tbuf);
27  
28      return rc;
29  }
30 @@ -2308,7 +2310,7 @@
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.029125 seconds and 3 git commands to generate.