diff options
author | 2022-11-28 09:01:53 +0000 | |
---|---|---|
committer | 2022-11-28 09:01:53 +0000 | |
commit | fe39d50e09c1fcf5d13386e15951c5608e7df0e4 (patch) | |
tree | 8101dfc2573c43705c09189a3589693fdaf14124 /vendor/codeberg.org/gruf/go-store | |
parent | fix missing lookup cache key for invalid domain block (#1158) (diff) | |
download | gotosocial-fe39d50e09c1fcf5d13386e15951c5608e7df0e4.tar.xz |
[chore]: Bump codeberg.org/gruf/go-store/v2 from 2.0.9 to 2.0.10 (#1160)
Bumps codeberg.org/gruf/go-store/v2 from 2.0.9 to 2.0.10.
---
updated-dependencies:
- dependency-name: codeberg.org/gruf/go-store/v2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-store')
4 files changed, 16 insertions, 14 deletions
diff --git a/vendor/codeberg.org/gruf/go-store/v2/storage/block.go b/vendor/codeberg.org/gruf/go-store/v2/storage/block.go index b1081cb1c..f41099c75 100644 --- a/vendor/codeberg.org/gruf/go-store/v2/storage/block.go +++ b/vendor/codeberg.org/gruf/go-store/v2/storage/block.go @@ -676,10 +676,6 @@ func (st *BlockStorage) nodePathForKey(key string) (string, error) { pb := util.GetPathBuilder() defer util.PutPathBuilder(pb) - // Append the nodepath to key - pb.AppendString(st.nodePath) - pb.AppendString(key) - // Return joined + cleaned node-path return pb.Join(st.nodePath, key), nil } diff --git a/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go b/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go index dab1d6128..ef6993edd 100644 --- a/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go +++ b/vendor/codeberg.org/gruf/go-store/v2/storage/disk.go @@ -394,16 +394,16 @@ func (st *DiskStorage) filepath(key string) (string, error) { pb := util.GetPathBuilder() defer util.PutPathBuilder(pb) - // Generated joined root path - pb.AppendString(st.path) - pb.AppendString(key) + // Generate key path + pb.Append(st.path) + pb.Append(key) // Check for dir traversal outside of root - if isDirTraversal(st.path, pb.StringPtr()) { + if isDirTraversal(st.path, pb.String()) { return "", ErrInvalidKey } - return pb.String(), nil + return string(pb.B), nil } // isDirTraversal will check if rootPlusPath is a dir traversal outside of root, diff --git a/vendor/codeberg.org/gruf/go-store/v2/storage/fs.go b/vendor/codeberg.org/gruf/go-store/v2/storage/fs.go index 658b7e762..48a5806f2 100644 --- a/vendor/codeberg.org/gruf/go-store/v2/storage/fs.go +++ b/vendor/codeberg.org/gruf/go-store/v2/storage/fs.go @@ -5,7 +5,7 @@ import ( "os" "syscall" - "codeberg.org/gruf/go-fastpath" + "codeberg.org/gruf/go-fastpath/v2" "codeberg.org/gruf/go-store/v2/util" ) diff --git a/vendor/codeberg.org/gruf/go-store/v2/util/pool.go b/vendor/codeberg.org/gruf/go-store/v2/util/pool.go index dc35dae01..ec5b501fe 100644 --- a/vendor/codeberg.org/gruf/go-store/v2/util/pool.go +++ b/vendor/codeberg.org/gruf/go-store/v2/util/pool.go @@ -1,16 +1,22 @@ package util import ( - "codeberg.org/gruf/go-fastpath" - "codeberg.org/gruf/go-pools" + "sync" + + "codeberg.org/gruf/go-fastpath/v2" ) // pathBuilderPool is the global fastpath.Builder pool. -var pathBuilderPool = pools.NewPathBuilderPool(512) +var pathBuilderPool = sync.Pool{ + New: func() any { + return &fastpath.Builder{B: make([]byte, 0, 512)} + }, +} // GetPathBuilder fetches a fastpath.Builder object from the pool. func GetPathBuilder() *fastpath.Builder { - return pathBuilderPool.Get() + pb, _ := pathBuilderPool.Get().(*fastpath.Builder) + return pb } // PutPathBuilder places supplied fastpath.Builder back in the pool. |