diff options
author | Michael Snyder <msnyder@vmware.com> | 2011-02-28 02:14:50 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2011-02-28 02:14:50 +0000 |
commit | ae179fba639d227c015767db97740509515491f1 (patch) | |
tree | 150aa25557c160c0d6acc66deccb695f2a5ea996 | |
parent | 4b812f4ed9ec8dc933c5603f958b84495c41534f (diff) | |
download | binutils-ae179fba639d227c015767db97740509515491f1.zip binutils-ae179fba639d227c015767db97740509515491f1.tar.gz binutils-ae179fba639d227c015767db97740509515491f1.tar.bz2 |
2011-02-27 Michael Snyder <msnyder@vmware.com>
* objc-lang.c (selectors_info): Prevent string overrun.
-rw-r--r-- | gdb/ChangeLog | 2 | ||||
-rw-r--r-- | gdb/objc-lang.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 941c611..041543b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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. diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index 25e13be..d795104 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 |