Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b1701b34890898dc083648cfc97f038bb6566131
      
https://github.com/WebKit/WebKit/commit/b1701b34890898dc083648cfc97f038bb6566131
  Author: Yusuke Suzuki <[email protected]>
  Date:   2026-08-17 (Mon, 17 Aug 2026)

  Changed paths:
    A JSTests/stress/uint8array-setFromBase64-zero-length-reads-nothing.js
    M JSTests/test262/expectations.yaml
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.cpp
    M Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.cpp
    M Source/WTF/wtf/text/Base64.cpp
    M Source/WTF/wtf/text/Base64.h

  Log Message:
  -----------
  [JSC] Check maxLength == 0 when specified in fromBase64
https://bugs.webkit.org/show_bug.cgi?id=321895
rdar://185073630

Reviewed by Sosuke Suzuki.

When maxLength is specified (setFromBase64 case), we stop processing
before touching anything[1] (see step 3). This patch correctly
implements it.

[1]: https://tc39.es/proposal-arraybuffer-base64/spec/#sec-frombase64

Test: JSTests/stress/uint8array-setFromBase64-zero-length-reads-nothing.js

* JSTests/stress/uint8array-setFromBase64-zero-length-reads-nothing.js: Added.
(shouldBe):
(lastChunkHandling.of.lastChunkHandlings.string.of.invalidStrings.shouldThrow):
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/wtf/text/Base64.cpp:
(WTF::fromBase64Impl):
(WTF::fromBase64):
* Source/WTF/wtf/text/Base64.h:

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



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

Reply via email to