File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -736,6 +736,7 @@ class ZlibStream final : public CompressionStream<ZlibContext> {
736736
737737 CHECK (args[4 ]->IsUint32Array ());
738738 Local<Uint32Array> array = args[4 ].As <Uint32Array>();
739+ CHECK_GE (array->Length (), 2 );
739740 Local<ArrayBuffer> ab = array->Buffer ();
740741 uint32_t * write_result = static_cast <uint32_t *>(ab->Data ());
741742
@@ -809,6 +810,7 @@ class BrotliCompressionStream final :
809810 CHECK (args.Length () == 3 && " init(params, writeResult, writeCallback)" );
810811
811812 CHECK (args[1 ]->IsUint32Array ());
813+ CHECK_GE (args[1 ].As <Uint32Array>()->Length (), 2 );
812814 uint32_t * write_result = reinterpret_cast <uint32_t *>(Buffer::Data (args[1 ]));
813815
814816 CHECK (args[2 ]->IsFunction ());
@@ -890,6 +892,7 @@ class ZstdStream final : public CompressionStream<CompressionContext> {
890892 ASSIGN_OR_RETURN_UNWRAP (&wrap, args.This ());
891893
892894 CHECK (args[2 ]->IsUint32Array ());
895+ CHECK_GE (args[2 ].As <Uint32Array>()->Length (), 2 );
893896 uint32_t * write_result = reinterpret_cast <uint32_t *>(Buffer::Data (args[2 ]));
894897
895898 CHECK (args[3 ]->IsFunction ());
You can’t perform that action at this time.
0 commit comments