Skip to content

Commit ac584ca

Browse files
(gosec) Apply G115 fixes to remaining internal packages
Address gosec G115 integer overflow warnings in: - internal/credproviders: credential provider conversions - internal/errutil: error code conversions - internal/israce: build tag updates - internal/integration: test helper conversions - x/mongo/driver test files
1 parent e85fa4e commit ac584ca

22 files changed

+45
-45
lines changed

internal/credproviders/static_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func verify(v credentials.Value) error {
4545
func (s *StaticProvider) Retrieve() (credentials.Value, error) {
4646
if !s.verified {
4747
s.err = verify(s.Value)
48-
s.Value.ProviderName = staticProviderName
48+
s.ProviderName = staticProviderName
4949
s.verified = true
5050
}
5151
return s.Value, s.err

internal/errutil/join_go1.19.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build !go1.20
8-
// +build !go1.20
98

109
package errutil
1110

internal/errutil/join_go1.20.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build go1.20
8-
// +build go1.20
98

109
package errutil
1110

internal/integration/client_side_encryption_prose_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build cse
8-
// +build cse
98

109
package integration
1110

internal/integration/client_side_encryption_spec_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build cse
8-
// +build cse
98

109
package integration
1110

internal/integration/client_side_encryption_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build cse
8-
// +build cse
98

109
package integration
1110

internal/integration/csot_cse_prose_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build cse
8-
// +build cse
98

109
package integration
1110

internal/integration/cursor_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,7 @@ func TestCursor_RemainingBatchLength(t *testing.T) {
215215
defer cursor.Close(context.Background())
216216
mt.ClearEvents()
217217

218-
for {
219-
if cursor.TryNext(context.Background()) {
220-
break
221-
}
218+
for !cursor.TryNext(context.Background()) {
222219

223220
assert.Nil(mt, cursor.Err(), "cursor error: %v", err)
224221
assert.Equal(mt,

internal/integration/errors_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build go1.13
8-
// +build go1.13
98

109
package integration
1110

internal/integration/mtest/csfle_enabled.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
66

77
//go:build cse
8-
// +build cse
98

109
package mtest
1110

0 commit comments

Comments
 (0)