WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
303428
CString.isEmpty() for String.utf8() returns true when String has a single character
https://bugs.webkit.org/show_bug.cgi?id=303428
Summary
CString.isEmpty() for String.utf8() returns true when String has a single cha...
ankshit
Reported
2025-12-02 15:36:24 PST
CString.isEmpty() for String.utf8() returns true when String has a single character. ``` String s = "a"_s; CString utf8 = s.utf8(); utf8.isEmpty() // true, should be false ```
Attachments
Add attachment
proposed patch, testcase, etc.
Alex Christensen
Comment 1
2025-12-02 15:42:45 PST
Seems to be broken since
https://commits.webkit.org/303011@main
We should probably return true if the length is 0 or the length is 1 and the contents are the null terminator character. Right now we don't check for the null terminator.
Xabier Rodríguez Calvar
Comment 2
2025-12-03 01:46:14 PST
Pull request:
https://github.com/WebKit/WebKit/pull/54762
EWS
Comment 3
2025-12-03 09:27:47 PST
Committed
303840@main
(1c43f6f71325): <
https://commits.webkit.org/303840@main
> Reviewed commits have been landed. Closing PR #54762 and removing active labels.
Radar WebKit Bug Importer
Comment 4
2025-12-03 09:28:12 PST
<
rdar://problem/165770081
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug