diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/demangle.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 807aa0b..db36920 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +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. + 2001-04-16 Mark Kettenis <kettenis@gnu.org> * i386-tdep.c (i386_frame_chain): New function. diff --git a/gdb/demangle.c b/gdb/demangle.c index 4b5bc9b..0104d8f 100644 --- a/gdb/demangle.c +++ b/gdb/demangle.c @@ -186,7 +186,7 @@ _initialize_demangler (void) libiberty_demanglers[ndems].demangling_style != unknown_demangling; ndems++) ; - demangling_style_names = xmalloc (ndems * sizeof (char *)); + demangling_style_names = xcalloc (ndems + 1, sizeof (char *)); for (i = 0; libiberty_demanglers[i].demangling_style != unknown_demangling; i++) |