Update module go.etcd.io/bbolt to v1.3.9

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-02-25 19:26:56 +00:00
committed by GitHub
parent d2c2e665e3
commit ecda4eab39
4 changed files with 23 additions and 15 deletions

2
go.mod
View File

@ -68,7 +68,7 @@ require (
github.com/ulikunitz/xz v0.5.11 github.com/ulikunitz/xz v0.5.11
github.com/vbauerster/mpb/v8 v8.7.2 github.com/vbauerster/mpb/v8 v8.7.2
github.com/vishvananda/netlink v1.2.1-beta.2 github.com/vishvananda/netlink v1.2.1-beta.2
go.etcd.io/bbolt v1.3.8 go.etcd.io/bbolt v1.3.9
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b golang.org/x/exp v0.0.0-20231226003508-02704c960a9b
golang.org/x/net v0.21.0 golang.org/x/net v0.21.0
golang.org/x/sync v0.6.0 golang.org/x/sync v0.6.0

4
go.sum
View File

@ -606,8 +606,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI=
go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/bbolt v1.3.9/go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE=
go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg= go.mongodb.org/mongo-driver v1.7.3/go.mod h1:NqaYOwnXWr5Pm7AOpO5QFxKJ503nbMse/R79oO62zWg=
go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng= go.mongodb.org/mongo-driver v1.7.5/go.mod h1:VXEWRZ6URJIkUq2SCAyapmhH0ZLRBP+FT4xhp5Zvxng=
go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8= go.mongodb.org/mongo-driver v1.10.0/go.mod h1:wsihk0Kdgv8Kqu1Anit4sfK+22vSFbUrAVEYRhCXrA8=

30
vendor/go.etcd.io/bbolt/bucket.go generated vendored
View File

@ -162,12 +162,17 @@ func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
return nil, ErrBucketNameRequired return nil, ErrBucketNameRequired
} }
// Insert into node.
// Tip: Use a new variable `newKey` instead of reusing the existing `key` to prevent
// it from being marked as leaking, and accordingly cannot be allocated on stack.
newKey := cloneBytes(key)
// Move cursor to correct position. // Move cursor to correct position.
c := b.Cursor() c := b.Cursor()
k, _, flags := c.seek(key) k, _, flags := c.seek(newKey)
// Return an error if there is an existing key. // Return an error if there is an existing key.
if bytes.Equal(key, k) { if bytes.Equal(newKey, k) {
if (flags & bucketLeafFlag) != 0 { if (flags & bucketLeafFlag) != 0 {
return nil, ErrBucketExists return nil, ErrBucketExists
} }
@ -182,16 +187,14 @@ func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
} }
var value = bucket.write() var value = bucket.write()
// Insert into node. c.node().put(newKey, newKey, value, 0, bucketLeafFlag)
key = cloneBytes(key)
c.node().put(key, key, value, 0, bucketLeafFlag)
// Since subbuckets are not allowed on inline buckets, we need to // Since subbuckets are not allowed on inline buckets, we need to
// dereference the inline page, if it exists. This will cause the bucket // dereference the inline page, if it exists. This will cause the bucket
// to be treated as a regular, non-inline bucket for the rest of the tx. // to be treated as a regular, non-inline bucket for the rest of the tx.
b.page = nil b.page = nil
return b.Bucket(key), nil return b.Bucket(newKey), nil
} }
// CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it. // CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it.
@ -288,18 +291,23 @@ func (b *Bucket) Put(key []byte, value []byte) error {
return ErrValueTooLarge return ErrValueTooLarge
} }
// Insert into node.
// Tip: Use a new variable `newKey` instead of reusing the existing `key` to prevent
// it from being marked as leaking, and accordingly cannot be allocated on stack.
newKey := cloneBytes(key)
// Move cursor to correct position. // Move cursor to correct position.
c := b.Cursor() c := b.Cursor()
k, _, flags := c.seek(key) k, _, flags := c.seek(newKey)
// Return an error if there is an existing key with a bucket value. // Return an error if there is an existing key with a bucket value.
if bytes.Equal(key, k) && (flags&bucketLeafFlag) != 0 { if bytes.Equal(newKey, k) && (flags&bucketLeafFlag) != 0 {
return ErrIncompatibleValue return ErrIncompatibleValue
} }
// Insert into node. // gofail: var beforeBucketPut struct{}
key = cloneBytes(key)
c.node().put(key, key, value, 0, 0) c.node().put(newKey, newKey, value, 0, 0)
return nil return nil
} }

2
vendor/modules.txt vendored
View File

@ -1097,7 +1097,7 @@ github.com/vishvananda/netns
# github.com/yusufpapurcu/wmi v1.2.3 # github.com/yusufpapurcu/wmi v1.2.3
## explicit; go 1.16 ## explicit; go 1.16
github.com/yusufpapurcu/wmi github.com/yusufpapurcu/wmi
# go.etcd.io/bbolt v1.3.8 # go.etcd.io/bbolt v1.3.9
## explicit; go 1.17 ## explicit; go 1.17
go.etcd.io/bbolt go.etcd.io/bbolt
# go.mongodb.org/mongo-driver v1.13.1 # go.mongodb.org/mongo-driver v1.13.1