git-gui: avoid auto_execok in do_windows_shortcut
git-gui on Windows uses auto_execok to locate git-gui.exe, which performs the same flawed search as does the builtin exec. Use _which instead, performing a safe PATH lookup. Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Mark Levedahl committed
Apr 3, 2025 at 00:37 UTC
00c7aa86e905175476e0dff149d570b48c34c8f1
1 file changed
+1
-1
lib/shortcut.tcl
+1
-1
index 674a41f5e0..263f4899c9 100644
--- a/lib/shortcut.tcl
+++ b/lib/shortcut.tcl
@@ -12,7 +12,7 @@ proc do_windows_shortcut {} {
set fn ${fn}.lnk
}
# Use git-gui.exe if available (ie: git-for-windows)
- set cmdLine [auto_execok git-gui.exe]
+ set cmdLine [list [_which git-gui]]
if {$cmdLine eq {}} {
set cmdLine [list [info nameofexecutable] \
[file normalize $::argv0]]