Repository navigation
Fix remaining null-to-empty-CefString CHECK() crash sites (#19/#20/#21) - #49
Merged
Merged
Conversation
PR #43 already guarded CefRequest_N.cpp's SetURL and SetHeaderByName's name param against a non-null-but-empty Java String reaching CEF's internal CHECK(!x.empty()) (a hard abort in a Debug/coverage build, silently permitted in Release since CEF's own generated ctocpp wrapper no-ops on empty right after the CHECK -- which never runs, because CHECK aborts first). This is the same bug's remaining call sites, all of which already had a null-Java-string guard but not the empty-string one: CefPostDataElement_N.cpp's SetToFile, CefRequest_N.cpp's SetMethod and Set(), and CefResponse_N.cpp's SetHeaderByName. Backport of coverage/phase1-value-objects-phase2-handlers' 92aed53, adapted to this branch's existing null-guard structure rather than a literal cherry-pick (that commit predates PR #43's null-vs-empty split for SetURL/SetHeaderByName). Adds four regression tests to the existing NullParameterEdgeCaseTest.java (no separate test file, since master doesn't yet have PR #43's MalformedInputEdgeCaseTest.java where the future branch's own equivalent tests would otherwise belong). Verified: full rebuild (native + Java), 18/18 tests pass running NullParameterEdgeCaseTest together with CefDownloadItemTest in the same JVM (NullParameterEdgeCaseTest creates CEF objects without ever creating a browser, and per TestSetupExtension's own documented design only reaches CEF's fully-initialized browser-process state once some test in the same run has created one -- confirmed this is a pre-existing run-in-isolation limitation of that test file, not something this change introduces, by reproducing the same crash on an untouched pre-existing test method with no relation to this fix). Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #49 +/- ##
============================================
+ Coverage 38.01% 38.20% +0.18%
- Complexity 735 741 +6
============================================
Files 243 243
Lines 14863 14889 +26
Branches 2449 2453 +4
============================================
+ Hits 5650 5688 +38
+ Misses 8011 7995 -16
- Partials 1202 1206 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CefRequest_N.cpp'sSetURLandSetHeaderByName's name param against a non-null-but-empty JavaStringreaching CEF's internalCHECK(!x.empty())(a hard abort in a Debug/coverage build, silently permitted in Release since CEF's own generated ctocpp wrapper no-ops on empty right after the CHECK -- which never runs, because CHECK aborts first).CefPostDataElement_N.cpp'sSetToFile,CefRequest_N.cpp'sSetMethodandSet(), andCefResponse_N.cpp'sSetHeaderByName.coverage/phase1-value-objects-phase2-handlers'92aed53, adapted to this branch's existing null-guard structure rather than a literal cherry-pick (that commit predates PR Validate malformed JNI input in CefRequest/CefPostDataElement (#19, #20, partial #21) #43's null-vs-empty split forSetURL/SetHeaderByName).NullParameterEdgeCaseTest.java(no separate test file, since master doesn't yet have PR Validate malformed JNI input in CefRequest/CefPostDataElement (#19, #20, partial #21) #43'sMalformedInputEdgeCaseTest.java).Test plan
ninja -C jcef_build jcef+tools/compile.sh linux64)NullParameterEdgeCaseTest(18 tests, including the 4 new ones) run together withCefDownloadItemTestin the same JVM: 18/18 passCefRequest_0_CppToC called with invalid version -1) reproduces identically on an untouched, unrelated pre-existing test method too -- it'sNullParameterEdgeCaseTest's own documented pre-existing limitation (perTestSetupExtension's comments: tests that never create a browser rely on an earlier browser-creating test in the same JVM run to bring CEF's browser-process fully up), not something this change introduces🤖 Generated with Claude Code
https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq