diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-26 23:59:21 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-11-27 13:15:38 +0100 |
commit | acf7e0b581cfbf33aef6df28b421467c3a20d4fc (patch) | |
tree | ea763bb3d28bd2bd25b1cd579bc02973b1ef24e4 /main.go | |
parent | go-patches: force PIE mode on arm (diff) | |
download | wireguard-windows-acf7e0b581cfbf33aef6df28b421467c3a20d4fc.tar.xz wireguard-windows-acf7e0b581cfbf33aef6df28b421467c3a20d4fc.zip |
main: restrict dll search path
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -134,6 +134,10 @@ func pipeFromHandleArgument(handleStr string) (*os.File, error) { } func main() { + if windows.SetDllDirectory("") != nil || windows.SetDefaultDllDirectories(windows.LOAD_LIBRARY_SEARCH_SYSTEM32) != nil { + panic("failed to restrict dll search path") + } + checkForWow64() if len(os.Args) <= 1 { |