Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix crash on demangle style completion
@ 2001-04-16  7:35 Daniel Berlin
  2001-04-16  8:35 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Berlin @ 2001-04-16  7:35 UTC (permalink / raw)
  To: gdb-patches

This is an obvious fix (Just try completing on the demangle style, and
look what happens), so i'm checking it in.

2001-04-16  Daniel Berlin  <dan@cgsoftware.com>
 
 	* demangle.c (_initialize_demangler): Use xcalloc on the
 	demangling_style_names, and make it a null terminated array of
 	names, to avoid a crash.
 


Index: demangle.c
===================================================================
RCS file: /cvs/src/src/gdb/demangle.c,v
retrieving revision 1.7
diff -c -3 -p -w -B -b -r1.7 demangle.c
*** demangle.c	2001/03/06 08:21:06	1.7
--- demangle.c	2001/04/16 14:34:53
*************** _initialize_demangler (void)
*** 186,192 ****
         libiberty_demanglers[ndems].demangling_style != unknown_demangling; 
         ndems++)
      ;
!   demangling_style_names = xmalloc (ndems * sizeof (char *));
    for (i = 0;
         libiberty_demanglers[i].demangling_style != unknown_demangling; 
         i++)
--- 186,192 ----
         libiberty_demanglers[ndems].demangling_style != unknown_demangling; 
         ndems++)
      ;
!   demangling_style_names = xcalloc (ndems + 1, sizeof (char *));
    for (i = 0;
         libiberty_demanglers[i].demangling_style != unknown_demangling; 
         i++)

-- 
I have two very rare photographs.  One is a picture of Houdini
locking his keys in his car.  The other is a rare photograph of
Norman Rockwell beating up a child.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix crash on demangle style completion
  2001-04-16  7:35 [PATCH] Fix crash on demangle style completion Daniel Berlin
@ 2001-04-16  8:35 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2001-04-16  8:35 UTC (permalink / raw)
  To: Daniel Berlin; +Cc: gdb-patches

On 16 Apr 2001, Daniel Berlin wrote:

> This is an obvious fix (Just try completing on the demangle style, and
> look what happens), so i'm checking it in.

Oops!  (I did try it, but perhaps I only typed strings that matched 
before it got to the end of the array.)

Thanks for catching this blunder.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-04-16  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-16  7:35 [PATCH] Fix crash on demangle style completion Daniel Berlin
2001-04-16  8:35 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox