From 5ff474a5113d6dde6abb9621a1f278549255e060 Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Wed, 4 Sep 2024 15:30:25 -0700 Subject: [PATCH] Security: resolve gosec G115 (CWE-190) --- internal/extra/banner.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/extra/banner.go b/internal/extra/banner.go index 1dd80a0..631b92d 100644 --- a/internal/extra/banner.go +++ b/internal/extra/banner.go @@ -17,7 +17,7 @@ import ( const hellpot = "H4sIAAAAAAACA8VXvW7bQAze9QpZOGQUZNXntBD6Ahm7Gx1cx0jdRnKRKAUCdPDgQavOgB/QTxLZ1P3oRJ5Obo0CtnE5feSR30fylOhmfjv9PEtzwIXIj4dds/xw2jsequNB2gizXd3Mxad2O81PX7AAe+UNGneuR8aUOuTsqQUDXAMv1cJE5Tfbn6GaKz45kpid+lQc3zoNY5zmEUEt+jCGNZUjeYr0StZYmbwtwNavuCaUFWA8MjxVIImjNas6TPQT9Tnq4MnYJF0zkhVU4rLvqflscU/ox0Lg45qKTjoSmiLQPA+ZuTT7BbrckpfWKMkUquTErIPEYbPoKjamy6SjR0feGssPUMYTCDWEnrR8c0m7hJ2B4jekK2KUsBfa7bpTD0ftnmKPE9nN2IzcLc99vxhIUbszlwqrJoklpQWlI6AeQh9nDHXj2ldOvyat/vZdDxVfzZdbSuspRUe/+IKZtxq2GWlbZzS6jnrnDEXGCkXUGnahuTgAA+DY9HU8FUoYH3ji/q84HetDWmT/Y3ml6oX21/eCNzB46+6UuVTSQHXgGmzUTJT/zeNQ3zCvysEBuH3hER9CbhNa6FoLHSBfT2gmK/rFKCj/K1nTfcBduKHVwgjo+Y+HilXBEAqhKg1X6lQzMaIF6ZK6ipVILR0Awh16SWy9KsxvZXWbL34oGpNmMcPNdYFmiE40+qV9cg4Logjm2uXjukzK5a/kYf28WpaTn4u3zcvkfvX09GVTnuFfEYzBNujvr9+S5SafvL0Wj+uiWBSrsov/I6axmMXiLhYf40zE2TTOZnF2F2fNn2n0DpcvBxhQEAAA" func rc(s []string) string { - return strings.TrimSpace(s[ru()%uint32(len(s))]) + return strings.TrimSpace(s[ru()%len(s)]) } func process(in string) (s string) { @@ -64,12 +64,12 @@ func process(in string) (s string) { return } -func ru() uint32 { +func ru() int { b := make([]byte, 8192) if _, err := crip.Read(b); err != nil { bannerFail(err) } - return binary.LittleEndian.Uint32(b) + return int(binary.LittleEndian.Uint32(b)) } // printBanner prints our entropic banner