diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-02-28 18:14:34 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-02-28 18:14:34 +0000 |
commit | 20937029912db1c246399ecf93fecae4117eeadf (patch) | |
tree | 1d089a596d68883edd83241566d99a99eef5bd24 /gdb/objc-lang.c | |
parent | 907b7f4fc8621c9ea70b67251fe9ea40617645b6 (diff) | |
download | gdb-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/objc-lang.c')
-rw-r--r-- | gdb/objc-lang.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 |