[Webkit-unassigned] [Bug 221428] New: WTF::dynamic_cf_cast<> should not assert in Debug builds

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 4 14:01:25 PST 2021


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

            Bug ID: 221428
           Summary: WTF::dynamic_cf_cast<> should not assert in Debug
                    builds
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Keywords: InRadar
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: darin at apple.com, ggaren at apple.com

WTF::dynamic_cf_cast<> should not assert in Debug builds.

The proper way to use dynamic_cf_cast<> is to do a nullptr check on its return results, and take action if the cast failed.  One of the most common use cases is when decoding (untrusted) serialized data, and instead of crashing, we just want to fail decoding on that particular chunk serialized data.

In some cases, we may way to add a nullptr check before calling it to differentiate that scenario from the wrong object type being detected.

We never want to use dynamic_cf_cast<> and assume it always succeeds, though.  In that case, we either want to use checked_cf_cast<> instead, or add a nullptr check to handle that scenario.

<rdar://problem/73451079>

-- 
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/20210204/30741e33/attachment.htm>


More information about the webkit-unassigned mailing list