feat(libSceJsc): answer the JSString null and length cases as JavaScriptCore does #12442

Merged
simnJS merged 2 commits from upstream-pr/12442 into main 2026-10-29 13:28:54 +00:00
simnJS commented 2026-10-28 13:42:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simnJS on 2026-10-28T13:42:12Z.


What

Six libSceJsc JavaScriptCore string exports were implemented on main, but a few of their inputs still went through NotImplemented_nid_no_patch. JavaScriptCore's own source defines those inputs, both in the WebKit commit the debt file already pins (f274ef4c03) and in Sony's PS5 WebKit for firmware 11.x (a GitHub copy of Sony's source release for firmware 11.00 to 11.60). They now answer as that source does:

  • JSStringCreateWithUTF8CString(nullptr) returns a new null string, as it does for malformed UTF-8. WebKit takes the null pointer as an empty span (StringCommon.h), StringImpl::create returns null for it (StringImpl.cpp), and the function then falls back to OpaqueJSString::create() (JSStringRef.cpp). Sony's 11.x version tests the pointer itself (JSStringRef.cpp).
  • A UTF-8 input to JSStringCreateWithUTF8CString or JSStringIsEqualToUTF8CString follows StringImpl::create(std::span<const char8_t>) (StringImpl.cpp):
    • more than INT32_MAX bytes throws std::length_error before decoding, where WebKit's RELEASE_ASSERT(isValidLength<char8_t>) fires;
    • malformed input under that limit stays a null string;
    • all-ASCII input becomes an 8-bit string, whose limit is also INT32_MAX;
    • other valid input that decodes to more than 2147483635 UTF-16 units throws, where the 16-bit StringImpl creation calls CRASH().
      The shared decoder checks both bounds with GuestJSStringValidLength<Unit> (Api.hpp), which mirrors isValidLength (StringImpl.h). JSStringCreateWithCharacters uses the same helper.
  • JSStringIsEqualToUTF8CString(string, nullptr) compares string with that null string (JSStringRef.cpp). It is true only for a null string, never for an empty string or a null handle (OpaqueJSString.cpp).
  • JSStringCreateWithCharacters(nullptr, count) returns a null string for any count. WTF's String constructor keeps a null pointer as a null string without reading it (WTFString.cpp; Sony 11.x: WTFString.cpp).
    • With characters, a length above 2147483635 throws std::length_error where WebKit calls CRASH() (StringImpl.h, L1273-L1281).
    • 2147483635 is (UINT32_MAX - sizeof(StringImpl)) / 2 with the 24-byte header of a 64-bit build: a 4-byte count, a 4-byte length, an 8-byte data pointer and 4-byte hash and flags, padded to 8 (StringImpl.h). main threw above INT32_MAX instead.
  • JSStringRetain, JSStringRelease and JSStringGetMaximumUTF8CStringSize dereference the handle without a check (JSStringRef.cpp; Sony 11.x: L68-L97), so the console faults on a null handle. They throw std::invalid_argument for it, as main already does where the console faults, for example in sigsuspend and feupdateenv.
  • The reference count is a 32-bit counter that wraps, as WTF's ThreadSafeRefCounted is (ThreadSafeRefCounted.h; Sony 11.x: L55-L100). A release deletes the string only when it takes the count from 1 to 0. main used a 64-bit counter and threw when it was full.
  • JSStringGetMaximumUTF8CStringSize computes length() * 3 + 1 in 32-bit unsigned arithmetic, as WebKit's unsigned length() does, so it wraps from 1431655765 units on.

The six names move from todo to done in tools/progress.py (libSceJsc 4 → 10 of 160). The debt entries keep what is still open: the console's JavaScriptCore version is unverified, and the null-handle and length faults throw. Sony's 11.x source has one difference, recorded there: it keeps the low 32 bits of a length of 2^32 or more (OpaqueJSString.h), which throws here as in pinned WebKit. Not measured on a console.

Tested

Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 r7 (x86_64-ucrt-posix-seh), Release, BUILD_TESTING=ON, on main 750cf6cf48. No title run.

  • guest_jsc_string (extended): passes, 40 runs on this head (ctest --repeat until-fail:20 twice). No other test links libSceJsc.
  • The new cases cover:
    • null UTF-16 characters with length 0 and with lengths 2147483636 to SIZE_MAX: a null string (length 0, null characters pointer) equal to the null UTF-8 string;
    • characters with lengths 2147483636, INT32_MAX, INT32_MAX + 1, UINT32_MAX, 2^32 and SIZE_MAX: std::length_error before any read, since the test's pointer is unreadable;
    • JSStringCreateWithUTF8CString(nullptr): length 0, a null characters pointer, maximum size 1 and an output of "". It equals malformed UTF-8 and null characters, but not the empty strings of either constructor;
    • JSStringIsEqualToUTF8CString with a null const char*, against null, malformed, empty and non-empty strings and a null handle, and a null handle against "";
    • a null handle in retain, release and the maximum-size query, each throwing std::invalid_argument;
    • the reference count going from 1 to 2 and back. A retain at UINT32_MAX wraps it to 0, and the next release takes it back to UINT32_MAX without deleting the string;
    • the maximum size of strings of 0 to 5 units and of 1000 units;
    • GuestJSStringValidLength at and around both limits: char8_t accepts up to INT32_MAX and refuses INT32_MAX + 1, 2^32 and SIZE_MAX; char16_t accepts 2147483635 and refuses 2147483636, INT32_MAX and above.
  • Not run: the 32-bit wrap of the maximum size from 1431655765 units on, accepted lengths near 2147483635, and UTF-8 inputs past either bound. All of them need a string of 2.8 GB or more, so the bounds are tested at the helper.
  • Control: with main's Export.cpp and Api.hpp put back, guest_jsc_string fails at its first new case. main reads 2147483636 units from the test's unreadable pointer (access violation at 0x1, exception 0xc0000005), where WebKit crashes before reading.
  • public_headers and public_headers_compile_*: 65/65 pass.
  • Full suites on GitHub runners from the fork, head 2b10aa4211:
    • Windows, the upstream build.yml in full mode (run): no failures out of 2837 tests (851 skipped), including guest_jsc_string.
    • Linux, Ubuntu 24.04 (run): 2 failures out of 2721 tests (759 skipped). guest_jsc_string and public_headers pass. Neither failure involves libSceJsc:
      • conventions_ci_gate comes from the fork's own workflow file, which was fixed on the fork after this run started;
      • precise_wait is a timing test that fails on the fork's main too.
  • python tools/check_conventions.py --base origin/main with this title and body: all checks pass. python tools/pr_overlap.py --branch feat/jsc-string-edge-answers: no overlap with open pull requests.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5051495811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12442). Originally posted by [simnJS](https://github.com/simnJS) on 2026-10-28T13:42:12Z. --- ### What Six `libSceJsc` JavaScriptCore string exports were implemented on `main`, but a few of their inputs still went through `NotImplemented_nid_no_patch`. JavaScriptCore's own source defines those inputs, both in the WebKit commit the debt file already pins (`f274ef4c03`) and in Sony's PS5 WebKit for firmware 11.x (a [GitHub copy](https://github.com/neonmodder123/PS5-WebKit-11.x/tree/80f77e94c63ee7202eec3d4b5b1a021dd89011ba) of Sony's source release for firmware 11.00 to 11.60). They now answer as that source does: - `JSStringCreateWithUTF8CString(nullptr)` returns a new null string, as it does for malformed UTF-8. WebKit takes the null pointer as an empty span ([StringCommon.h](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/StringCommon.h#L55-L60)), `StringImpl::create` returns null for it ([StringImpl.cpp](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/StringImpl.cpp#L267-L272)), and the function then falls back to `OpaqueJSString::create()` ([JSStringRef.cpp](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/JavaScriptCore/API/JSStringRef.cpp#L44-L50)). Sony's 11.x version tests the pointer itself ([JSStringRef.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/JavaScriptCore/API/JSStringRef.cpp#L43-L60)). - A UTF-8 input to `JSStringCreateWithUTF8CString` or `JSStringIsEqualToUTF8CString` follows `StringImpl::create(std::span<const char8_t>)` ([StringImpl.cpp](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/StringImpl.cpp#L267-L291)): - more than `INT32_MAX` bytes throws `std::length_error` before decoding, where WebKit's `RELEASE_ASSERT(isValidLength<char8_t>)` fires; - malformed input under that limit stays a null string; - all-ASCII input becomes an 8-bit string, whose limit is also `INT32_MAX`; - other valid input that decodes to more than 2147483635 UTF-16 units throws, where the 16-bit `StringImpl` creation calls `CRASH()`. The shared decoder checks both bounds with `GuestJSStringValidLength<Unit>` (`Api.hpp`), which mirrors `isValidLength` ([StringImpl.h](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/StringImpl.h#L1238-L1244)). `JSStringCreateWithCharacters` uses the same helper. - `JSStringIsEqualToUTF8CString(string, nullptr)` compares `string` with that null string ([JSStringRef.cpp](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/JavaScriptCore/API/JSStringRef.cpp#L109-L112)). It is true only for a null string, never for an empty string or a null handle ([OpaqueJSString.cpp](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/JavaScriptCore/API/OpaqueJSString.cpp#L101-L110)). - `JSStringCreateWithCharacters(nullptr, count)` returns a null string for any `count`. WTF's `String` constructor keeps a null pointer as a null string without reading it ([WTFString.cpp](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/WTFString.cpp#L43-L46); Sony 11.x: [WTFString.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/text/WTFString.cpp#L43-L46)). - With characters, a length above 2147483635 throws `std::length_error` where WebKit calls `CRASH()` ([StringImpl.h](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/StringImpl.h#L1238-L1244), [L1273-L1281](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/StringImpl.h#L1273-L1281)). - 2147483635 is `(UINT32_MAX - sizeof(StringImpl)) / 2` with the 24-byte header of a 64-bit build: a 4-byte count, a 4-byte length, an 8-byte data pointer and 4-byte hash and flags, padded to 8 ([StringImpl.h](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/text/StringImpl.h#L161-L171)). `main` threw above `INT32_MAX` instead. - `JSStringRetain`, `JSStringRelease` and `JSStringGetMaximumUTF8CStringSize` dereference the handle without a check ([JSStringRef.cpp](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/JavaScriptCore/API/JSStringRef.cpp#L58-L87); Sony 11.x: [L68-L97](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/JavaScriptCore/API/JSStringRef.cpp#L68-L97)), so the console faults on a null handle. They throw `std::invalid_argument` for it, as `main` already does where the console faults, for example in [`sigsuspend`](https://github.com/boykopovar/AnyPS5/blob/750cf6cf487f948017295b1f3717af6f886f0f85/core/libs/prx/libkernel/System/src/Signals.cpp#L776) and [`feupdateenv`](https://github.com/boykopovar/AnyPS5/blob/750cf6cf487f948017295b1f3717af6f886f0f85/core/libs/prx/libc/src/Math.cpp#L2012). - The reference count is a 32-bit counter that wraps, as WTF's `ThreadSafeRefCounted` is ([ThreadSafeRefCounted.h](https://github.com/WebKit/WebKit/blob/f274ef4c03ebace644c46f8ec55746b391acdcc8/Source/WTF/wtf/ThreadSafeRefCounted.h#L41-L80); Sony 11.x: [L55-L100](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/ThreadSafeRefCounted.h#L55-L100)). A release deletes the string only when it takes the count from 1 to 0. `main` used a 64-bit counter and threw when it was full. - `JSStringGetMaximumUTF8CStringSize` computes `length() * 3 + 1` in 32-bit unsigned arithmetic, as WebKit's `unsigned length()` does, so it wraps from 1431655765 units on. The six names move from todo to done in `tools/progress.py` (libSceJsc 4 → 10 of 160). The debt entries keep what is still open: the console's JavaScriptCore version is unverified, and the null-handle and length faults throw. Sony's 11.x source has one difference, recorded there: it keeps the low 32 bits of a length of 2^32 or more ([OpaqueJSString.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/JavaScriptCore/API/OpaqueJSString.h#L49-L52)), which throws here as in pinned WebKit. Not measured on a console. ### Tested Windows 11 Pro 10.0.26200, WinLibs GCC 15.2.0 r7 (x86_64-ucrt-posix-seh), Release, `BUILD_TESTING=ON`, on `main` `750cf6cf48`. No title run. - `guest_jsc_string` (extended): passes, 40 runs on this head (`ctest --repeat until-fail:20` twice). No other test links libSceJsc. - The new cases cover: - null UTF-16 characters with length 0 and with lengths 2147483636 to `SIZE_MAX`: a null string (length 0, null characters pointer) equal to the null UTF-8 string; - characters with lengths 2147483636, `INT32_MAX`, `INT32_MAX + 1`, `UINT32_MAX`, 2^32 and `SIZE_MAX`: `std::length_error` before any read, since the test's pointer is unreadable; - `JSStringCreateWithUTF8CString(nullptr)`: length 0, a null characters pointer, maximum size 1 and an output of `""`. It equals malformed UTF-8 and null characters, but not the empty strings of either constructor; - `JSStringIsEqualToUTF8CString` with a null `const char*`, against null, malformed, empty and non-empty strings and a null handle, and a null handle against `""`; - a null handle in retain, release and the maximum-size query, each throwing `std::invalid_argument`; - the reference count going from 1 to 2 and back. A retain at `UINT32_MAX` wraps it to 0, and the next release takes it back to `UINT32_MAX` without deleting the string; - the maximum size of strings of 0 to 5 units and of 1000 units; - `GuestJSStringValidLength` at and around both limits: `char8_t` accepts up to `INT32_MAX` and refuses `INT32_MAX + 1`, 2^32 and `SIZE_MAX`; `char16_t` accepts 2147483635 and refuses 2147483636, `INT32_MAX` and above. - Not run: the 32-bit wrap of the maximum size from 1431655765 units on, accepted lengths near 2147483635, and UTF-8 inputs past either bound. All of them need a string of 2.8 GB or more, so the bounds are tested at the helper. - Control: with `main`'s `Export.cpp` and `Api.hpp` put back, `guest_jsc_string` fails at its first new case. `main` reads 2147483636 units from the test's unreadable pointer (access violation at `0x1`, exception `0xc0000005`), where WebKit crashes before reading. - `public_headers` and `public_headers_compile_*`: 65/65 pass. - Full suites on GitHub runners from the fork, head `2b10aa4211`: - Windows, the upstream `build.yml` in full mode ([run](https://github.com/simnJS/AnyPS5/actions/runs/40718958372)): no failures out of 2837 tests (851 skipped), including `guest_jsc_string`. - Linux, Ubuntu 24.04 ([run](https://github.com/simnJS/AnyPS5/actions/runs/40718915779)): 2 failures out of 2721 tests (759 skipped). `guest_jsc_string` and `public_headers` pass. Neither failure involves libSceJsc: - `conventions_ci_gate` comes from the fork's own workflow file, which was fixed on the fork after this run started; - `precise_wait` is a timing test that fails on the fork's `main` too. - `python tools/check_conventions.py --base origin/main` with this title and body: all checks pass. `python tools/pr_overlap.py --branch feat/jsc-string-edge-answers`: no overlap with open pull requests. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-28 13:50:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T13:50:17Z.

Review: COMMENTED


I reviewed the exact head 422de87a44 and manually compiled and ran GuestJscString.cpp with the PR Export.cpp under GCC 12/C++20; the test executable passed. The minimal harness supplied only the unrelated no-patch export handler needed to link this standalone test, so this is not a full project build. The added null/empty, malformed UTF-8, surrogate, buffer-boundary, and ownership cases align with the implementation and cited WebKit behavior; I found no defect in the reviewed paths. Hosted convention/eligibility checks were still queued at my last refresh, and CMake configuration here is blocked by the missing SDL2 source/XRandR support.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5683708865 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12442#pullrequestreview-5683708865). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T13:50:17Z. **Review:** COMMENTED --- I reviewed the exact head `422de87a44` and manually compiled and ran `GuestJscString.cpp` with the PR `Export.cpp` under GCC 12/C++20; the test executable passed. The minimal harness supplied only the unrelated no-patch export handler needed to link this standalone test, so this is not a full project build. The added null/empty, malformed UTF-8, surrogate, buffer-boundary, and ownership cases align with the implementation and cited WebKit behavior; I found no defect in the reviewed paths. Hosted convention/eligibility checks were still queued at my last refresh, and CMake configuration here is blocked by the missing SDL2 source/XRandR support.
MarcZX10 commented 2026-10-28 13:58:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T13:58:32Z.

Review: COMMENTED


Rechecked the rebased/current head 50c8d4cd8f after the force-push. Its source/test tree is unchanged from the head I previously compiled and ran; the GCC 12/C++20 standalone GuestJscString harness passed, with the previously noted limitation that a temporary handler was needed only for unrelated no-patch exports. The new hosted checks are queued. The earlier code review therefore still applies to this exact tree; this is a COMMENTED follow-up, not an approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5683835740 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12442#pullrequestreview-5683835740). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T13:58:32Z. **Review:** COMMENTED --- Rechecked the rebased/current head `50c8d4cd8f` after the force-push. Its source/test tree is unchanged from the head I previously compiled and ran; the GCC 12/C++20 standalone `GuestJscString` harness passed, with the previously noted limitation that a temporary handler was needed only for unrelated no-patch exports. The new hosted checks are queued. The earlier code review therefore still applies to this exact tree; this is a COMMENTED follow-up, not an approval.
MarcZX10 commented 2026-10-28 14:30:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T14:30:00Z.

Review: CHANGES_REQUESTED


One remaining length-path mismatch: Decode(const char* text) appends decoded UTF-16 units until the NUL terminator without enforcing JavaScriptCore’s maximum source/string length. The newly added MaximumLength guard is used by JSStringCreateWithCharacters, but JSStringCreateWithUTF8CString (and JSStringIsEqualToUTF8CString) can still accept and allocate from a C string longer than the pinned WebKit limit. In the cited WebKit revision, StringImpl::create(std::span<const char8_t>) applies isValidLength<char8_t> and the resulting string construction also enforces MaxLength (StringImpl.h, isValidLength); the UTF-8 decoder here has no equivalent check and may grow beyond it if a sufficiently large input is available. Please enforce the corresponding input/decoded-length bound before growing the vector (and cover the boundary with a helper-level test or otherwise document why this path is intentionally different). I have not allocated a multi-gigabyte string locally, so this is a source-based edge-case finding, not a claimed runtime reproduction. All applicable hosted checks and the exact-head GuestJscString test were green in the prior review; this is the remaining issue preventing approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5684315934 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12442#pullrequestreview-5684315934). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T14:30:00Z. **Review:** CHANGES_REQUESTED --- One remaining length-path mismatch: `Decode(const char* text)` appends decoded UTF-16 units until the NUL terminator without enforcing JavaScriptCore’s maximum source/string length. The newly added `MaximumLength` guard is used by `JSStringCreateWithCharacters`, but `JSStringCreateWithUTF8CString` (and `JSStringIsEqualToUTF8CString`) can still accept and allocate from a C string longer than the pinned WebKit limit. In the cited WebKit revision, `StringImpl::create(std::span<const char8_t>)` applies `isValidLength<char8_t>` and the resulting string construction also enforces `MaxLength` (`StringImpl.h`, `isValidLength`); the UTF-8 decoder here has no equivalent check and may grow beyond it if a sufficiently large input is available. Please enforce the corresponding input/decoded-length bound before growing the vector (and cover the boundary with a helper-level test or otherwise document why this path is intentionally different). I have not allocated a multi-gigabyte string locally, so this is a source-based edge-case finding, not a claimed runtime reproduction. All applicable hosted checks and the exact-head `GuestJscString` test were green in the prior review; this is the remaining issue preventing approval.
MarcZX10 commented 2026-10-28 15:29:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T15:29:26Z.

Review: APPROVED


Reviewed exact head 2b10aa4211019c51de352517a43198cb3956e41a. The previously missing UTF-8 path now checks the byte length before decoding and checks the decoded UTF-16 length for non-ASCII strings; ASCII is bounded by the byte-length limit. The shared helper matches the documented 32-bit byte-size and signed-length constraints, and its tests cover both accepted and rejected boundaries without allocating multi-gigabyte inputs. The author reports 40 focused Windows runs, negative controls, and 65/65 public-header checks; hosted Windows, conventions and policy checks pass. My independent diff-check and merge-tree check pass. The earlier review finding is resolved; no blocker remains.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5685251392 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12442#pullrequestreview-5685251392). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T15:29:26Z. **Review:** APPROVED --- Reviewed exact head `2b10aa4211019c51de352517a43198cb3956e41a`. The previously missing UTF-8 path now checks the byte length before decoding and checks the decoded UTF-16 length for non-ASCII strings; ASCII is bounded by the byte-length limit. The shared helper matches the documented 32-bit byte-size and signed-length constraints, and its tests cover both accepted and rejected boundaries without allocating multi-gigabyte inputs. The author reports 40 focused Windows runs, negative controls, and 65/65 public-header checks; hosted Windows, conventions and policy checks pass. My independent diff-check and merge-tree check pass. The earlier review finding is resolved; no blocker remains.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!12442
No description provided.