| Summary: | Crash under WebKit::XPCServiceMain | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
| Component: | WebKit2 | Assignee: | Chris Dumez <cdumez> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | achristensen, darin, ddkilzer, ggaren, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Chris Dumez
2020-05-07 15:30:18 PDT
Created attachment 398806 [details]
Patch
Comment on attachment 398806 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398806&action=review > Source/WebKit/ChangeLog:12 > + - Crash under strcmp() could in theory happen if expectedBundleVersion.UTF8String was null, which could > + happen if expectedBundleVersion was null. I now use higher level String types for the versions, make > + sure they are not null and use String comparison to compare them. I understand how checks for null are a good idea. Not sure why using WTF::String is helpful. (In reply to Darin Adler from comment #3) > Comment on attachment 398806 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=398806&action=review > > > Source/WebKit/ChangeLog:12 > > + - Crash under strcmp() could in theory happen if expectedBundleVersion.UTF8String was null, which could > > + happen if expectedBundleVersion was null. I now use higher level String types for the versions, make > > + sure they are not null and use String comparison to compare them. > > I understand how checks for null are a good idea. Not sure why using > WTF::String is helpful. This was my own personal preference, I much prefer dealing C++ types, than C or ObjC types. We are getting one of the version as a const char* and there other as a NSString*, both can silently be converted to String type, so this was convenient too. Created attachment 398808 [details]
Patch
(In reply to Chris Dumez from comment #5) > Created attachment 398808 [details] > Patch Fixes iOS build. Committed r261360: <https://trac.webkit.org/changeset/261360> All reviewed patches have been landed. Closing bug and clearing flags on attachment 398808 [details]. I hope that this fixes all crashes _under_ WebKit::XPCServiceMain ;) Comment on attachment 398808 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398808&action=review > Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:142 > + String webKitBundleVersion = xpc_dictionary_get_string(bootstrap.get(), "WebKitBundleVersion"); Just noticed a change in behavior here. The old code treated this as UTF-8. The new code treats it as Latin-1. But I suspect really this is all guaranteed to be ASCII so this change in behavior is not important. |