[Webkit-unassigned] [Bug 196855] Fix Covscan uninitialized after ctor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Apr 14 17:36:36 PDT 2019


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

--- Comment #26 from Michael Catanzaro <mcatanzaro at igalia.com> ---
We're now talking about extreme micro-optimization at the cost of safety and robustness. The case we discussed up above, in comment #21, seems like case in point to me. Although you're right that the code is correct in its current form -- I was wrong about that -- it's easy to see a small and seemingly-correct change to this code would result in uninitialized memory read. Short-circuiting to avoid e.g. dereferencing NULL is common practice; short-circuiting to avoid uninitialized memory reads is not. The checks could easily be moved around in the future. Or a getter function could be added to the class. It's just too fragile. Humans are not good enough to avoid such mistakes; we can check to make sure local variables we declare in functions are initialized before first use, but it's just too hard if we can't assume that classes are fully-initialized.

-- 
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/20190415/11891456/attachment.html>


More information about the webkit-unassigned mailing list