Skip to content

Commit c57a2ce

Browse files
authored
Make sure nothing is nil in tmp slice (#1423)
1 parent f095481 commit c57a2ce

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: args.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,10 @@ func visitArgsKey(args []argsKV, f func(k []byte)) {
371371
func copyArgs(dst, src []argsKV) []argsKV {
372372
if cap(dst) < len(src) {
373373
tmp := make([]argsKV, len(src))
374+
dstLen := len(dst)
374375
dst = dst[:cap(dst)] // copy all of dst.
375376
copy(tmp, dst)
376-
for i := len(dst); i < len(tmp); i++ {
377+
for i := dstLen; i < len(tmp); i++ {
377378
// Make sure nothing is nil.
378379
tmp[i].key = []byte{}
379380
tmp[i].value = []byte{}

0 commit comments

Comments
 (0)