From 66d93da954bd65ec3b16a7125686b049ebf859b8 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Tue, 27 Feb 2018 09:51:05 +0100 Subject: [PATCH] Update deps; this fixes something related to Windows registry --- Gopkg.lock | 4 ++-- vendor/golang.org/x/sys/windows/registry/key.go | 10 ++++------ .../golang.org/x/sys/windows/registry/registry_test.go | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 3f9d070a..7153207a 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -130,7 +130,7 @@ "poly1305", "salsa20/salsa" ] - revision = "432090b8f568c018896cd8a0fb0345872bbac6ce" + revision = "beaf6a35706e5032ae4c3fcf342c663c069f44d2" [[projects]] branch = "master" @@ -154,7 +154,7 @@ "windows/svc/eventlog", "windows/svc/mgr" ] - revision = "37707fdb30a5b38865cfb95e5aab41707daec7fd" + revision = "f6cff0780e542efa0c8e864dc8fa522808f6a598" [solve-meta] analyzer-name = "dep" diff --git a/vendor/golang.org/x/sys/windows/registry/key.go b/vendor/golang.org/x/sys/windows/registry/key.go index d0beb195..c2564834 100644 --- a/vendor/golang.org/x/sys/windows/registry/key.go +++ b/vendor/golang.org/x/sys/windows/registry/key.go @@ -113,12 +113,10 @@ func OpenRemoteKey(pcname string, k Key) (Key, error) { // The parameter n controls the number of returned names, // analogous to the way os.File.Readdirnames works. func (k Key) ReadSubKeyNames(n int) ([]string, error) { - ki, err := k.Stat() - if err != nil { - return nil, err - } - names := make([]string, 0, ki.SubKeyCount) - buf := make([]uint16, ki.MaxSubKeyLen+1) // extra room for terminating zero byte + names := make([]string, 0) + // Registry key size limit is 255 bytes and described there: + // https://msdn.microsoft.com/library/windows/desktop/ms724872.aspx + buf := make([]uint16, 256) //plus extra room for terminating zero byte loopItems: for i := uint32(0); ; i++ { if n > 0 { diff --git a/vendor/golang.org/x/sys/windows/registry/registry_test.go b/vendor/golang.org/x/sys/windows/registry/registry_test.go index 3cb9771c..2f4dd69e 100644 --- a/vendor/golang.org/x/sys/windows/registry/registry_test.go +++ b/vendor/golang.org/x/sys/windows/registry/registry_test.go @@ -29,7 +29,7 @@ func randKeyName(prefix string) string { } func TestReadSubKeyNames(t *testing.T) { - k, err := registry.OpenKey(registry.CLASSES_ROOT, "TypeLib", registry.ENUMERATE_SUB_KEYS|registry.QUERY_VALUE) + k, err := registry.OpenKey(registry.CLASSES_ROOT, "TypeLib", registry.ENUMERATE_SUB_KEYS) if err != nil { t.Fatal(err) }