From 20d36cd9a22bf28c6945b7bec837ad02835fce8d Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Mon, 1 Jan 2024 15:11:43 +0100 Subject: [PATCH] set: Remove a broken array read Hardcode "--erase" as a hack, because "argv[-1]" is *not* a thing. Introduced in aacc71e58520309027fd39e30038e6c42bdc9a2f. Fixed in master by no longer being C++. --- src/builtins/set.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/builtins/set.cpp b/src/builtins/set.cpp index 9417b884d..4257c90a5 100644 --- a/src/builtins/set.cpp +++ b/src/builtins/set.cpp @@ -244,7 +244,7 @@ static int validate_cmd_opts(const wchar_t *cmd, const set_cmd_opts_t &opts, int } if (argc == 0 && opts.erase) { - streams.err.append_format(BUILTIN_ERR_MISSING, cmd, argv[-1]); + streams.err.append_format(BUILTIN_ERR_MISSING, cmd, L"--erase"); builtin_print_error_trailer(parser, streams.err, cmd); return STATUS_INVALID_ARGS; }