This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] symtab.c: make sure alloca is big enough
- From: Elena Zannoni <ezannoni at cygnus dot com>
- To: Michael Snyder <msnyder at cygnus dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 5 Dec 2001 08:53:27 -0500
- Subject: Re: [PATCH] symtab.c: make sure alloca is big enough
- References: <200112031928.fB3JSql03665@reddwarf.cygnus.com>
Michael Snyder writes:
> 2001-12-03 Michael Snyder <msnyder@redhat.com>
>
> * symtab.c (search_symbols): Make sure alloca size is big enough.
Michael,
have you checked this in? If not please do.
Where would this problem manifest itself?
Some testsuite cases?
Thanks
Elena
>
> Index: symtab.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/symtab.c,v
> retrieving revision 1.48
> diff -c -3 -p -r1.48 symtab.c
> *** symtab.c 2001/11/13 16:42:50 1.48
> --- symtab.c 2001/12/03 19:28:26
> *************** search_symbols (char *regexp, namespace_
> *** 2422,2428 ****
> /* If wrong number of spaces, fix it. */
> if (fix >= 0)
> {
> ! char *tmp = (char *) alloca (strlen (regexp) + fix);
> sprintf (tmp, "operator%.*s%s", fix, " ", opname);
> regexp = tmp;
> }
> --- 2422,2428 ----
> /* If wrong number of spaces, fix it. */
> if (fix >= 0)
> {
> ! char *tmp = (char *) alloca (8 + fix + strlen (opname) + 1);
> sprintf (tmp, "operator%.*s%s", fix, " ", opname);
> regexp = tmp;
> }