From 50412521e8708f30e84ebd7d01bda034daf6411c Mon Sep 17 00:00:00 2001 From: Michael Snyder Date: Tue, 15 Mar 2011 18:07:34 +0000 Subject: [PATCH] 2011-03-04 Michael Snyder * objc-lang.c (selectors_info): Check strchr for null result. --- gdb/ChangeLog | 2 ++ gdb/objc-lang.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c27cd8b1df3..11378c08dc4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-03-15 Michael Snyder + * objc-lang.c (selectors_info): Check strchr for null result. + * stabsread.c (define_symbol): Guard against bad stabstring input. 2011-03-15 Pierre Muller diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 90b881fdaf2..dfa5388fb31 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -752,6 +752,13 @@ selectors_info (char *regexp, int from_tty) continue; /* Find selector part. */ name = (char *) strchr (name+2, ' '); + if (name == NULL) + { + complaint (&symfile_complaints, + _("Bad method name '%s'"), + SYMBOL_NATURAL_NAME (msymbol)); + continue; + } if (regexp == NULL || re_exec(++name) != 0) { char *mystart = name; -- 2.30.2