mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-17 16:26:47 +03:00
Make sure nothing is nil in tmp slice (#1423)
This commit is contained in:
@@ -371,9 +371,10 @@ func visitArgsKey(args []argsKV, f func(k []byte)) {
|
||||
func copyArgs(dst, src []argsKV) []argsKV {
|
||||
if cap(dst) < len(src) {
|
||||
tmp := make([]argsKV, len(src))
|
||||
dstLen := len(dst)
|
||||
dst = dst[:cap(dst)] // copy all of dst.
|
||||
copy(tmp, dst)
|
||||
for i := len(dst); i < len(tmp); i++ {
|
||||
for i := dstLen; i < len(tmp); i++ {
|
||||
// Make sure nothing is nil.
|
||||
tmp[i].key = []byte{}
|
||||
tmp[i].value = []byte{}
|
||||
|
||||
Reference in New Issue
Block a user