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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 24 08:12:59 PDT 2020


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

--- Comment #8 from Anders Carlsson <andersca at apple.com> ---
(In reply to Darin Adler from comment #6)
> Comment on attachment 397335 [details]
> 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.

Good point, I missed the ASSERT_NOT_REACHED in the original patch.

-- 
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/b4def671/attachment-0001.htm>


More information about the webkit-unassigned mailing list