Commit 24c11ac
committed
Test that empty
The `EXEPATH` optimization in `system_prefix()` on Windows relies
on `EXEPATH` either being unset or set to a value where it is okay
to attempt to find and use `clangarm64`, `mingw64`, and `mingw32`
subdirectories. Like most environment variables, `EXEPATH` is
unlikely to be directly controllable by an attacker. But it may
exist with a different meaning from any we (and Git for Windows)
intend. It also may inadvertently be set to an empty string, or
intnetionally set to a relative path; in either case, we cannot
safely use it for the `EXEPATH` optimization in `system_prefix()`.
In particular, if it is an empty string, then an attempt would be
made to use a `clangarm64`, `mingw64`, or `mingw32` subdirectory of
the current working directory.
This test will fail until the `EXEPATH` optimization is refined to
bail out--and fall back to the more robust strategy--if `EXEPATH`
is an empty string, or under broader conditions such as it not
being an absolute path.EXEPATH doesn't trigger the optimization1 parent 5ac8cff commit 24c11ac
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
107 | 123 | | |
0 commit comments