diff options
author | 2003-08-06 04:40:55 +0000 | |
---|---|---|
committer | 2003-08-06 04:40:55 +0000 | |
commit | e108480d1fede549dc878fd7361f296d6cdfc6ea (patch) | |
tree | 4f5846b4f319f027faea0f8676e2186b55d15ead | |
parent | whitespace pretties. sorry, couldn't take it anymore (diff) | |
download | wireguard-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.c | 15 |
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) |