Skip to content

Commit a313165

Browse files
committed
main: restrict dll search path
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
1 parent 0298c1c commit a313165

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ func pipeFromHandleArgument(handleStr string) (*os.File, error) {
134134
}
135135

136136
func main() {
137+
if windows.SetDllDirectory("") != nil || windows.SetDefaultDllDirectories(windows.LOAD_LIBRARY_SEARCH_SYSTEM32) != nil {
138+
panic("failed to restrict dll search path")
139+
}
140+
137141
checkForWow64()
138142

139143
if len(os.Args) <= 1 {

0 commit comments

Comments
 (0)