aboutsummaryrefslogtreecommitdiff
path: root/gdb/expprint.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2007-09-05 00:14:02 +0000
committerMichael Snyder <msnyder@vmware.com>2007-09-05 00:14:02 +0000
commitfcd776e5474bde02e7555b33ef57905eae0f7d3e (patch)
tree035ca6ddd12340d92a6e02ef948c3bf0a9ca1333 /gdb/expprint.c
parent7d63ec12b1a2ee139aa79364d39e698b235c3ebb (diff)
downloadgdb-fcd776e5474bde02e7555b33ef57905eae0f7d3e.zip
gdb-fcd776e5474bde02e7555b33ef57905eae0f7d3e.tar.gz
gdb-fcd776e5474bde02e7555b33ef57905eae0f7d3e.tar.bz2
2007-09-04 Michael Snyder <msnyder@access-company.com>
* expprint.c (print_subexp_standard): Check strchr for null. * Makefile.in (expprint.o): Depend on gdb_assert.h.
Diffstat (limited to 'gdb/expprint.c')
-rw-r--r--gdb/expprint.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/expprint.c b/gdb/expprint.c
index 1dba437..6f1fcbf 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -30,6 +30,7 @@
#include "gdb_string.h"
#include "block.h"
#include "objfiles.h"
+#include "gdb_assert.h"
#ifdef HAVE_CTYPE_H
#include <ctype.h>
@@ -212,6 +213,7 @@ print_subexp_standard (struct expression *exp, int *pos,
for (tem = 0; tem < nargs; tem++)
{
nextS = strchr (s, ':');
+ gdb_assert (nextS); /* Make sure we found ':'. */
*nextS = '\0';
fprintf_unfiltered (stream, " %s: ", s);
s = nextS + 1;