Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 223bd0faeeb84888c1553f315d35408758143ba3
      
https://github.com/WebKit/WebKit/commit/223bd0faeeb84888c1553f315d35408758143ba3
  Author: Sergey Rubanov <[email protected]>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    A JSTests/stress/arraybuffer-grow-resize-huge-length.js
    M Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp

  Log Message:
  -----------
  [JSC] Check ArrayBuffer grow/resize length before converting to size_t
https://bugs.webkit.org/show_bug.cgi?id=323440
https://bugs.webkit.org/show_bug.cgi?id=323441

Reviewed by Yusuke Suzuki.

grow and resize used ToIntegerOrInfinity and then cast to size_t after
only checking finite and non-negative. A value such as 1e20 is in range
for double but not for size_t.

Use toIndex so the result is uint64_t and a negative length throws
RangeError before the detached check.

* JSTests/stress/arraybuffer-grow-resize-huge-length.js: Added.
* Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp:
(arrayBufferProtoFuncResize):
(sharedArrayBufferProtoFuncGrow):

Canonical link: https://commits.webkit.org/320821@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to