mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
net/interfaces: trim getPACWindows whitespace before parsing URL
Fixes #2357 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
1e83b97498
commit
440566c5d2
@ -9,6 +9,7 @@
|
||||
"log"
|
||||
"net"
|
||||
"net/url"
|
||||
"strings"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
@ -198,6 +199,10 @@ func getPACWindows() string {
|
||||
}
|
||||
defer globalFree.Call(uintptr(unsafe.Pointer(res)))
|
||||
s := windows.UTF16PtrToString(res)
|
||||
s = strings.TrimSpace(s)
|
||||
if s == "" {
|
||||
return "" // Issue 2357: invalid URL "\n" from winhttp; ignoring
|
||||
}
|
||||
if _, err := url.Parse(s); err != nil {
|
||||
log.Printf("getPACWindows: invalid URL %q from winhttp; ignoring", s)
|
||||
return ""
|
||||
|
Loading…
Reference in New Issue
Block a user