Skip to content

Commit 2c29534

Browse files
authored
Merge pull request #713 from henrybear327/cve/CVE-2023-45288-release-1.3
Bump go toolchain version to address CVE-2023-45288 for release-1.3
2 parents 9f3524b + 9b60c13 commit 2c29534

9 files changed

Lines changed: 8 additions & 18 deletions

File tree

.github/workflows/failpoint_test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ jobs:
1717
- run: |
1818
make gofail-enable
1919
make test-failpoint
20-

.github/workflows/tests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,3 @@ jobs:
102102
with:
103103
go-version: ${{ steps.goversion.outputs.goversion }}
104104
- run: make coverage
105-

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17.13
1+
1.21.9

cmd/bbolt/main_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main_test
33
import (
44
"bytes"
55
crypto "crypto/rand"
6-
"encoding/binary"
76
"fmt"
87
"io"
98
"math/rand"
@@ -304,12 +303,6 @@ func NewMain() *Main {
304303
}
305304

306305
func TestCompactCommand_Run(t *testing.T) {
307-
var s int64
308-
if err := binary.Read(crypto.Reader, binary.BigEndian, &s); err != nil {
309-
t.Fatal(err)
310-
}
311-
rand.Seed(s)
312-
313306
dstdb := btesting.MustCreateDB(t)
314307
dstdb.Close()
315308

freelist_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ func benchmark_FreelistRelease(b *testing.B, size int) {
320320
}
321321

322322
func randomPgids(n int) []pgid {
323-
rand.Seed(42)
324323
pgids := make(pgids, n)
325324
for i := range pgids {
326325
pgids[i] = pgid(rand.Int63())

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
module go.etcd.io/bbolt
22

3-
go 1.17
3+
go 1.21
44

55
require (
66
github.com/stretchr/testify v1.8.1
77
go.etcd.io/gofail v0.1.0
8+
golang.org/x/sync v0.5.0
89
golang.org/x/sys v0.4.0
910
)
1011

1112
require (
1213
github.com/davecgh/go-spew v1.1.1 // indirect
1314
github.com/pmezard/go-difflib v1.0.0 // indirect
14-
golang.org/x/sync v0.5.0 // indirect
1515
gopkg.in/yaml.v3 v3.0.1 // indirect
1616
)

manydbs_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package bbolt
22

33
import (
4+
"crypto/rand"
45
"fmt"
5-
"math/rand"
66
"os"
77
"path/filepath"
88
"testing"
@@ -46,7 +46,9 @@ func createAndPutKeys(t *testing.T) {
4646
}
4747

4848
var key [16]byte
49-
rand.Read(key[:])
49+
if _, err := rand.Read(key[:]); err != nil {
50+
return err
51+
}
5052
if err := nodes.Put(key[:], nil); err != nil {
5153
return err
5254
}

simulation_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ func testSimulate(t *testing.T, openOption *bolt.Options, round, threadCount, pa
3535
t.Skip("skipping test in short mode.")
3636
}
3737

38-
rand.Seed(int64(qseed))
39-
4038
// A list of operations that readers and writers can perform.
4139
var readerHandlers = []simulateHandler{simulateGetHandler}
4240
var writerHandlers = []simulateHandler{simulateGetHandler, simulatePutHandler}

unsafe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func unsafeByteSlice(base unsafe.Pointer, offset uintptr, i, j int) []byte {
3232
// manipulation of reflect.SliceHeader to prevent misuse, namely, converting
3333
// from reflect.SliceHeader to a Go slice type.
3434
func unsafeSlice(slice, data unsafe.Pointer, len int) {
35-
s := (*reflect.SliceHeader)(slice)
35+
s := (*reflect.SliceHeader)(slice) //nolint:staticcheck
3636
s.Data = uintptr(data)
3737
s.Cap = len
3838
s.Len = len

0 commit comments

Comments
 (0)