summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/gdb
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-08-06 04:40:56 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-08-06 04:40:56 +0000
commit164cd23bdee3afe096932be9272c39d58a40bd18 (patch)
tree8fbf4311d8cb9b1f655805a05ca2244c283e0cfa /gnu/usr.bin/binutils/gdb
parent870a53cb501bd8f6b285e33080a5ed21d80f48aa (diff)
backport a fix from current gdb to fix a crash when using set enum
without an argument. problem reported by adrian at coresecurity.com ok millert@
Diffstat (limited to 'gnu/usr.bin/binutils/gdb')
-rw-r--r--gnu/usr.bin/binutils/gdb/command.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gnu/usr.bin/binutils/gdb/command.c b/gnu/usr.bin/binutils/gdb/command.c
index c3c2b98a974..b0b945881e1 100644
--- a/gnu/usr.bin/binutils/gdb/command.c
+++ b/gnu/usr.bin/binutils/gdb/command.c
@@ -1233,6 +1233,21 @@ do_setshow_command (arg, from_tty, c)
char *match;
char *p;
+ if (arg == NULL)
+ {
+ char msg[1024];
+ strlcpy(msg, "Requires an argument. Valid arguments are ",
+ sizeof msg);
+ for (i = 0; c->enums[i]; i++)
+ {
+ if (i != 0)
+ strlcat(msg, ", ", sizeof msg);
+ strlcat(msg, c->enums[i], sizeof msg);
+ }
+ strlcat(msg, ".", sizeof msg);
+ error("%s", msg);
+ }
+
p = strchr (arg, ' ');
if (p)