aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-02-28 18:14:34 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-02-28 18:14:34 +0000
commit20937029912db1c246399ecf93fecae4117eeadf (patch)
tree1d089a596d68883edd83241566d99a99eef5bd24 /gdb
parent907b7f4fc8621c9ea70b67251fe9ea40617645b6 (diff)
downloadgdb-20937029912db1c246399ecf93fecae4117eeadf.zip
gdb-20937029912db1c246399ecf93fecae4117eeadf.tar.gz
gdb-20937029912db1c246399ecf93fecae4117eeadf.tar.bz2
gdb/
* objc-lang.c (selectors_info): Error on too long REGEXP.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/objc-lang.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 13fd70f..e0be521 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-28 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * objc-lang.c (selectors_info): Error on too long REGEXP.
+
2011-02-28 Michael Snyder <msnyder@vmware.com>
* linux-record.c (record_linux_system_call): Add missing
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index d795104..26b7fb1 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -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