From: Michael Snyder Date: Mon, 28 Feb 2011 02:14:50 +0000 (+0000) Subject: 2011-02-27 Michael Snyder X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ae179fba639d227c015767db97740509515491f1;p=binutils-gdb.git 2011-02-27 Michael Snyder * objc-lang.c (selectors_info): Prevent string overrun. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 941c6113309..041543b310f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2011-02-27 Michael Snyder + * objc-lang.c (selectors_info): Prevent string overrun. + * tui/tui-stack.c (tui_get_function_from_frame): Fix off by one error in strncpy. diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 25e13be5cf6..d795104986b 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -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