2011-02-28 Michael Snyder <msnyder@vmware.com>
* objc-lang.c (selectors_info): Add a small safety margin to avoid overflow. (classes_info): Error out on too long REGEXP.
This commit is contained in:
parent
098ab5127c
commit
2828854127
|
@ -1,5 +1,9 @@
|
||||||
2011-02-28 Michael Snyder <msnyder@vmware.com>
|
2011-02-28 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* objc-lang.c (selectors_info): Add a small safety margin to
|
||||||
|
avoid overflow.
|
||||||
|
(classes_info): Error out on too long REGEXP.
|
||||||
|
|
||||||
* infrun.c (handle_inferior_event): Remove unused function call.
|
* infrun.c (handle_inferior_event): Remove unused function call.
|
||||||
|
|
||||||
* fork-child.c (fork_inferior): Remove ifdef'd code and
|
* fork-child.c (fork_inferior): Remove ifdef'd code and
|
||||||
|
|
|
@ -720,7 +720,7 @@ selectors_info (char *regexp, int from_tty)
|
||||||
strcpy(myregexp, ".*]");
|
strcpy(myregexp, ".*]");
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (sizeof (myregexp) < strlen (regexp) + 1)
|
if (sizeof (myregexp) < strlen (regexp) + 4)
|
||||||
error (_("Regexp is too long: %s"), regexp);
|
error (_("Regexp is too long: %s"), regexp);
|
||||||
strcpy(myregexp, regexp);
|
strcpy(myregexp, regexp);
|
||||||
if (myregexp[strlen(myregexp) - 1] == '$') /* end of selector */
|
if (myregexp[strlen(myregexp) - 1] == '$') /* end of selector */
|
||||||
|
@ -863,6 +863,8 @@ classes_info (char *regexp, int from_tty)
|
||||||
strcpy(myregexp, ".* "); /* Null input: match all objc classes. */
|
strcpy(myregexp, ".* "); /* Null input: match all objc classes. */
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (sizeof (myregexp) < strlen (regexp) + 4)
|
||||||
|
error (_("Regexp is too long: %s"), regexp);
|
||||||
strcpy(myregexp, regexp);
|
strcpy(myregexp, regexp);
|
||||||
if (myregexp[strlen(myregexp) - 1] == '$')
|
if (myregexp[strlen(myregexp) - 1] == '$')
|
||||||
/* In the method name, the end of the class name is marked by ' '. */
|
/* In the method name, the end of the class name is marked by ' '. */
|
||||||
|
|
Loading…
Reference in New Issue