fix(libSceNKWebKit): read URL::user, password and protocolHostAndPort without the valid bit #26396
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/26396"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ToRaNek on 2026-11-23T22:21:21Z.
What
Resubmission of #24136, which was closed when my fork left the fork network (I switched it to private by mistake) and cannot be reopened. Same head commit
06d92a26386; the reviews and the discussion are on #24136.URL::user,URL::passwordandURL::protocolHostAndPortbegan with a test of the URL's valid bit and returned a nullStringwhen it was clear. WebKit has no such test in any of the three (URL.cppL170-L231; the same ate12a212a531aandc55364d53f97):They read the offsets and the string whatever the bit says. For a URL the parser rejected, the offsets are all zero and the string is the text as given, so the results are:
not a urluser()not a urlprotocolHostAndPort()not a urlpassword()The difference is what
isNull()answers on the result. A caller that only testsisEmpty()sees no change.The three exports now return a null string only when the URL's string is null, and otherwise go on as WebKit does.
password()is changed with the other two so the three stay alike; its result for a rejected URL was already right, because a URL without a password gives a null view.This is stacked on #22472, which rewrites the first lines of the same three functions to read the URL through a checked copy; the first commit of this branch merges it.
Tested
Windows 11 IoT Enterprise LTSC 2024 (10.0.26100), WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON.core/libs/prx/libSceNKWebKit/tests/WtfValues.cpp: a rejected URL with the textnot a url(empty and not null fromuserandprotocolHostAndPort, null frompassword), a URL with a null string (null from all three), and the existing hand-built URL whose valid bit is clear but whose offsets are set, which now gives what its offsets say, as the source would.mainfd7fe562edplus #22472,nkwebkit_wtfvaluesfails at the first check on the rejected URL.ctest -R "^nkwebkit_"passes 161 of 161, #22472's new test included.python tools/check_conventions.py --base origin/mainpasses.python tools/pr_overlap.py --branch fix/nkwebkit-url-credentials-ignore-validity: no overlap with open pull requests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-23T22:35:09Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
06d92a2638:tools/check_conventions.pypassed.nkwebkit_wtfpersistenceurlguestpointers_tests,nkwebkit_wtfvalues_testsbuilt cleanly.nkwebkit_wtfpersistenceurlguestpointers,nkwebkit_wtfvalues):core/libs/prx/libSceNKWebKit/src/WtfValues.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-24T00:15:25Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
8435b3524d:tools/check_conventions.pypassed.nkwebkit_wtfpersistenceurlguestpointers_tests,nkwebkit_wtfvalues_testsbuilt cleanly.nkwebkit_wtfpersistenceurlguestpointers,nkwebkit_wtfvalues):core/libs/prx/libSceNKWebKit/src/WtfValues.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-24T00:31:25Z.
Review: CHANGES_REQUESTED
Blocking stack-integration issue on exact head
8435b3524dbe81e9c602e99f4dffed1f84d84fa3.The two changes specific to this PR review cleanly: removing the URL valid-bit gate from
user(),password()andprotocolHostAndPort()matches pinned WebKit, and the current-headDecoderHasRoom(..., std::size_t)repair correctly fixes the Windows 4 GiB truncation. PrivacyOnion's exact-head Linux negative control and the green hosted Windows job support those points.However, this branch says it depends on #22472 but currently embeds only that PR's first guest-pointer commit
5b7140766399...(via mergeaf9349...). #22472 has since advanced through three additional correctness commits to642dd4043378...:3517150f...: copy the guest URL beforeprotocolIs(const char*)delegates;bcb24a8d...: commit a grown Persistence::Encoder buffer/capacity to the guest before freeing the old buffer, and clean up the new allocation if that guest-header write fails;642dd404...: read Encoder payload throughGuestCopyInbefore writing/hashing it.Those are fixes to the dependency code that this head still carries in its earlier form. If #26396 were merged as this exact stack head before #22472, it would include the stale guest-pointer implementation and miss those fixes. Please restack/rebase onto current #22472, then retain this PR's URL valid-bit change and the
std::size_tDecoder fix on top. After that, the focused URL semantics do not need redesign; I only need to verify the dependency range and exact-head checks.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T14:53:13Z.
Review: COMMENTED
Reviewed — no blocking findings
The prepared diff and relevant code at head
40d27518ee839080fc06bc84c34bdad271080f0ewere inspected; no tests were run, so a formal approval is not justified.What I ran
Read the prepared description, commit list, manifest, diff, and relevant ranges of all three changed files through
repo_read.py. No build or test command was run.Results
Negative control
Not run; no test command was run.
Findings
Blocking
None identified in the inspected changes.
Non-blocking
None.
Sources
The reviewed behavior and changes are in
core/libs/prx/libSceNKWebKit/src/WtfValues.cpp,core/libs/prx/libSceNKWebKit/tests/WtfPersistenceUrlGuestPointers.cpp, andcore/libs/prx/libSceNKWebKit/tests/WtfValues.cppat the pinned head.Not verified
Build and tests reported in the PR description were not run. The review folder’s
files.jsonwas unavailable; the manifest and file listing show three changed files, all included. Relevant changed code was inspected, but the full contents of every changed file were not read.To get this to a good state
Nothing is required. Optional: run the reported build and test checks on this head before merge.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T08:51:52Z.
Review: COMMENTED
Both Linux fixtures,
WtfValuesandWtfPersistenceUrlGuestPointers, passed with the exact changed source. The added assertions distinguish an empty string from a null string and exercise the credential and protocol/host/port accessors when the validity bit is clear.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.