| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -494,7 +494,12 @@ MaybeLocal<Object> New(Environment* env, | |||
| 494 | 494 | size_t length) { | |
| 495 | 495 | if (length > 0) { | |
| 496 | 496 | CHECK_NOT_NULL(data); | |
| 497 | - CHECK(length <= kMaxLength); | ||
| 497 | + // V8 currently only allows a maximum Typed Array index of max Smi. | ||
| 498 | + if (length > kMaxLength) { | ||
| 499 | + Isolate* isolate(env->isolate()); | ||
| 500 | + isolate->ThrowException(ERR_BUFFER_TOO_LARGE(isolate)); | ||
| 501 | + return Local<Object>(); | ||
| 502 | + } | ||
| 498 | 503 | } | |
| 499 | 504 | ||
| 500 | 505 | auto free_callback = [](char* data, void* hint) { free(data); }; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments