summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2003-08-06 04:40:55 +0000
committertedu <tedu@openbsd.org>2003-08-06 04:40:55 +0000
commite108480d1fede549dc878fd7361f296d6cdfc6ea (patch)
tree4f5846b4f319f027faea0f8676e2186b55d15ead
parentwhitespace pretties. sorry, couldn't take it anymore (diff)
downloadwireguard-openbsd-e108480d1fede549dc878fd7361f296d6cdfc6ea.tar.xz
wireguard-openbsd-e108480d1fede549dc878fd7361f296d6cdfc6ea.zip
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@
-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)