[Webkit-unassigned] [Bug 210911] Nullptr crash in objc_msgSend under WebCore::genericFamily

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Apr 23 18:34:42 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=210911

--- Comment #6 from Darin Adler <darin at apple.com> ---
Comment on attachment 397335
  --> https://bugs.webkit.org/attachment.cgi?id=397335
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=397335&action=review

>>>> Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:253
>>>> +        auto value = adoptCF(CTFontDescriptorCopyAttribute(descriptor.get(), kCTFontFamilyNameAttribute));
>>> 
>>> Can use dynamic_cf_cast here.
>>> 
>>> https://trac.webkit.org/browser/webkit/trunk/Source/WTF/wtf/cf/TypeCastsCF.h
>> 
>> Or checked_cf_cast, since we know what the type is supposed to be
> 
> Wouldn't that just cause a different crash though?

I’m puzzled about which is correct; if it’s a programming error to have the wrong type, then checked_cf_cast seems with. If it’s not a programming mistake then dynamic_cf_cast is the right thing to use, but asserting is wrong. This patch does ASSERT_NOT_REACHED, so it’s like a third "half bad" case.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200424/6f916091/attachment.htm>


More information about the webkit-unassigned mailing list