mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-22 02:52:00 -08:00
upgrade buntdb
Resolves CVE-2021-42836, which probably didn't affect us, but we might as well upgrade.
This commit is contained in:
parent
404bf6c2a0
commit
c972a92e51
11 changed files with 560 additions and 246 deletions
16
vendor/github.com/tidwall/buntdb/buntdb.go
generated
vendored
16
vendor/github.com/tidwall/buntdb/buntdb.go
generated
vendored
|
|
@ -1263,12 +1263,15 @@ type dbItem struct {
|
|||
keyless bool // keyless item for scanning
|
||||
}
|
||||
|
||||
// estIntSize returns the string representions size.
|
||||
// Has the same result as len(strconv.Itoa(x)).
|
||||
func estIntSize(x int) int {
|
||||
if x == 0 {
|
||||
return 1
|
||||
n := 1
|
||||
if x < 0 {
|
||||
n++
|
||||
x *= -1
|
||||
}
|
||||
var n int
|
||||
for x > 0 {
|
||||
for x >= 10 {
|
||||
n++
|
||||
x /= 10
|
||||
}
|
||||
|
|
@ -1283,7 +1286,10 @@ func estBulkStringSize(s string) int {
|
|||
return 1 + estIntSize(len(s)) + 2 + len(s) + 2
|
||||
}
|
||||
|
||||
func (dbi *dbItem) estAOFSetSize() (n int) {
|
||||
// estAOFSetSize returns an estimated number of bytes that this item will use
|
||||
// when stored in the aof file.
|
||||
func (dbi *dbItem) estAOFSetSize() int {
|
||||
var n int
|
||||
if dbi.opts != nil && dbi.opts.ex {
|
||||
n += estArraySize(5)
|
||||
n += estBulkStringSize("set")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue