fix(libSceNKWebKit): read URL::user, password and protocolHostAndPort without the valid bit #24136
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24136"
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-20T07:19:42Z.
What
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-20T07:43:43Z.
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 MarcZX10 on 2026-11-20T07:49:56Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the notes below are optional.
What I ran
Reviewed head
06d92a26386fbd4c0ebd1f17aab81fb99c10ddb2and the prepared diff. No test commands were run; the test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The added guest-pointer tests and changed behavior were not executed in this review. The PR description reports 161 passing
nkwebkittests and a passing conventions check; these results were not independently verified. Files read:core/libs/prx/libSceNKWebKit/src/WtfValues.cpp,core/libs/prx/libSceNKWebKit/tests/WtfPersistenceUrlGuestPointers.cpp,core/libs/prx/libSceNKWebKit/tests/WtfValues.cpp,core/libs/prx/libSceNKWebKit/CMakeLists.txt,core/libs/prx/libc/src/General.cpp, plusreview/description.md,review/commits.md,review/manifest.json, andreview/diff.patch. The reviewed changed files were all included in the prepared bundle; no changed files were excluded.To get this to a good state
Nothing is required.
Pull request closed