* objc-lang.c (selectors_info): Error on too long REGEXP.
This commit is contained in:
Jan Kratochvil 2011-02-28 18:14:34 +00:00
parent 907b7f4fc8
commit 2093702991
2 changed files with 7 additions and 1 deletions

View file

@ -720,7 +720,9 @@ selectors_info (char *regexp, int from_tty)
strcpy(myregexp, ".*]");
else
{
strncpy(myregexp, regexp, sizeof (myregexp) - 1);
if (sizeof (myregexp) < strlen (regexp) + 1)
error (_("Regexp is too long: %s"), regexp);
strcpy(myregexp, regexp);
if (myregexp[strlen(myregexp) - 1] == '$') /* end of selector */
myregexp[strlen(myregexp) - 1] = ']'; /* end of method name */
else