summaryrefslogtreecommitdiff
path: root/gdb/demangle.c
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2001-04-16 14:36:16 +0000
committerDaniel Berlin <dberlin@dberlin.org>2001-04-16 14:36:16 +0000
commit9a744434bfe47ca34f739ef1c3431913eef71a6c (patch)
tree2f98e898280eb767ee65c34011626bfedf75de24 /gdb/demangle.c
parent2d78b058f663b5bd5f21b5f2e235b80a31294d4d (diff)
downloadgdb-9a744434bfe47ca34f739ef1c3431913eef71a6c.tar.gz
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.
Diffstat (limited to 'gdb/demangle.c')
-rw-r--r--gdb/demangle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/demangle.c b/gdb/demangle.c
index 4b5bc9becbd..0104d8f3f6e 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++)