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.
This commit is contained in:
Daniel Berlin 2001-04-16 14:36:16 +00:00
parent a5dd804ef9
commit 9e0c176c3b
2 changed files with 7 additions and 1 deletions

View File

@ -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.

View File

@ -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++)