summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-04-14 20:10:33 +0000
committerschwarze <schwarze@openbsd.org>2014-04-14 20:10:33 +0000
commit69e50597b4bb7669d0a5b7e411963bf7e78f2337 (patch)
tree577f9f54d524b36fc716c9772445f2cea8a59564
parentCalculate the length of name and value for parameters the right way (diff)
downloadwireguard-openbsd-69e50597b4bb7669d0a5b7e411963bf7e78f2337.tar.xz
wireguard-openbsd-69e50597b4bb7669d0a5b7e411963bf7e78f2337.zip
Deny requests to display interactive help unless we can be really sure
that they actually result from the user interactively asking for help. Help requests originating from various other sources caused infinite loops. OK millert@ "better than getting stuck in a help loop (sweet irony ;)" jmc@
-rw-r--r--usr.bin/less/command.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/less/command.c b/usr.bin/less/command.c
index 4ca9a18481b..23acb1faabd 100644
--- a/usr.bin/less/command.c
+++ b/usr.bin/less/command.c
@@ -1461,6 +1461,13 @@ commands()
*/
if (ch_getflags() & CH_HELPFILE)
break;
+ if (ungot != NULL || unget_end) {
+ error(less_is_more
+ ? "Invalid option -p h"
+ : "Invalid option ++h",
+ NULL_PARG);
+ break;
+ }
cmd_exec();
save_hshift = hshift;
hshift = 0;