summaryrefslogtreecommitdiff
path: root/src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-29 13:33:37 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-12-05 12:36:42 +0000
commitbe9379f8a8e2bfd924966020d177552d01833fdb (patch)
treedb23482d49a7ea01f4436d97d13f9bb4fc0c5c77 /src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
parent4de4480dc34fbe4f7b0ed97eada26aef7a7e2337 (diff)
downloadgo-git-be9379f8a8e2bfd924966020d177552d01833fdb.tar.gz
syscall: correct CertOpenStore to expect a 0 return value on failure
According to [1], this function returns NULL when it errors, rather than INVALID_HANDLE_VALUE, which other Win32 functions return. This was pointed out in CL 273446 for the x/sys package, and this patch here cleans it up for the syscall package and updates the vendored x/sys package using the usual `go get/go mod vendor` dance. The function is currently in use by crypto/x509/root_windows.go, which calls CertOpenStore(CERT_STORE_PROV_MEMORY), which I assume can fail under OOM or other weird conditions. Quick reversing indicates that [1] is correct, as there's a `xor eax, eax` in the error paths of the function just before jumping to the epilogue. [1] https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certopenstore#return-value Change-Id: I77c0b0319c13313212f8710785252c494da56ed5 Reviewed-on: https://go-review.googlesource.com/c/go/+/273827 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Trust: Jason A. Donenfeld <Jason@zx2c4.com> Trust: Alex Brainman <alex.brainman@gmail.com>
Diffstat (limited to 'src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s')
-rw-r--r--src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s b/src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
index ded8260f3e..1f2c755a72 100644
--- a/src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
+++ b/src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build !gccgo
+// +build gc
#include "textflag.h"