strcpy(myregexp, ".*]");
else
{
- if (sizeof (myregexp) < strlen (regexp) + 1)
+ /* Allow a few extra bytes because of the strcat below. */
+ if (sizeof (myregexp) < strlen (regexp) + 4)
error (_("Regexp is too long: %s"), regexp);
strcpy(myregexp, regexp);
if (myregexp[strlen(myregexp) - 1] == '$') /* end of selector */
{
QUIT;
name = SYMBOL_NATURAL_NAME (msymbol);
- if (name &&
- (name[0] == '-' || name[0] == '+') &&
- name[1] == '[') /* Got a method name. */
+ if (name
+ && (name[0] == '-' || name[0] == '+')
+ && name[1] == '[') /* Got a method name. */
{
/* Filter for class/instance methods. */
if (plusminus && name[0] != plusminus)
continue;
/* Find selector part. */
- name = (char *) strchr(name+2, ' ');
+ 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;
- char *myend = (char *) strchr(mystart, ']');
+ char *myend = (char *) strchr (mystart, ']');
if (myend && (myend - mystart > maxlen))
maxlen = myend - mystart; /* Get longest selector. */
strcpy(myregexp, ".* "); /* Null input: match all objc classes. */
else
{
+ /* Allow a few extra bytes because of the strcat below. */
+ if (sizeof (myregexp) < strlen (regexp) + 4)
+ error (_("Regexp is too long: %s"), regexp);
strcpy(myregexp, regexp);
if (myregexp[strlen(myregexp) - 1] == '$')
/* In the method name, the end of the class name is marked by ' '. */
pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc,
¤t_target);
+ objfile_csym++;
+
if (symtab)
if (pc < BLOCK_START (block) || pc >= BLOCK_END (block))
/* Not in the specified symtab. */
if (parse_method (tmp, &ntype, &nclass,
&ncategory, &nselector) == NULL)
continue;
-
- objfile_csym++;
if ((type != '\0') && (ntype != type))
continue;