2011-02-27 Michael Snyder <msnyder@vmware.com>

* objc-lang.c (selectors_info): Prevent string overrun.
This commit is contained in:
Michael Snyder 2011-02-28 02:14:50 +00:00
parent 4b812f4ed9
commit ae179fba63
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2011-02-27 Michael Snyder <msnyder@vmware.com>
* objc-lang.c (selectors_info): Prevent string overrun.
* tui/tui-stack.c (tui_get_function_from_frame): Fix off by one
error in strncpy.

View File

@ -720,7 +720,7 @@ selectors_info (char *regexp, int from_tty)
strcpy(myregexp, ".*]");
else
{
strcpy(myregexp, regexp);
strncpy(myregexp, regexp, sizeof (myregexp) - 1);
if (myregexp[strlen(myregexp) - 1] == '$') /* end of selector */
myregexp[strlen(myregexp) - 1] = ']'; /* end of method name */
else