aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-01-12 17:53:58 -0800
committerGravatar GitHub <noreply@github.com> 2023-01-12 17:53:58 -0800
commit297732bbb3799c20d86547af42be2bbe8dc3fe15 (patch)
tree7dfeee50eaad53d2eccce9d517c97306ecb9e467
parent90be2543734609bcf917da869c25bf441de5bd7c (diff)
downloadbun-297732bbb3799c20d86547af42be2bbe8dc3fe15.tar.gz
bun-297732bbb3799c20d86547af42be2bbe8dc3fe15.tar.zst
bun-297732bbb3799c20d86547af42be2bbe8dc3fe15.zip
0 initialize remaining indexes in array (#1783)
* 0 initialize remaining indexes in array * switch to memset
-rw-r--r--src/bun.js/bindings/JSBufferList.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bun.js/bindings/JSBufferList.cpp b/src/bun.js/bindings/JSBufferList.cpp
index e54b433e5..0c9815d9e 100644
--- a/src/bun.js/bindings/JSBufferList.cpp
+++ b/src/bun.js/bindings/JSBufferList.cpp
@@ -75,6 +75,8 @@ JSC::JSValue JSBufferList::concat(JSC::VM& vm, JSC::JSGlobalObject* lexicalGloba
i += length;
}
+ memset(uint8Array->typedVector() + i, 0, n - i);
+
RELEASE_AND_RETURN(throwScope, uint8Array);
}