zlib: add CHECK to validate fast path input

PR-URL: https://github.com/nodejs/node/pull/61175
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Matteo Collina authored and RafaelGSS committed 2026-01-13 10:04:56 -03:00
1 parent 86bce15e96
commit c09417a2b1
1 file changed
+1
+1
View File
@@ -1685,6 +1685,7 @@ static uint32_t FastCRC32(v8::Local<v8::Value> receiver,
v8::FastApiCallbackOptions& options) {
TRACK_V8_FAST_API_CALL("zlib.crc32");
v8::HandleScope handle_scope(options.isolate);
CHECK(data->IsArrayBufferView() || data->IsString());
return CRC32Impl(options.isolate, data, value);
}