[mythtv-commits] Ticket #4742: dyncast can return zero. Resulting pointer should be checked in mythui
MythTV
mythtv at cvs.mythtv.org
Fri Feb 22 18:15:16 UTC 2008
#4742: dyncast can return zero. Resulting pointer should be checked in mythui
---------------------------------------------+------------------------------
Reporter: Erik Hovland <erik at hovland.org> | Owner: ijr
Type: defect | Status: new
Priority: trivial | Milestone: 0.21
Component: mythtv | Version: head
Severity: low | Mlocked: 0
---------------------------------------------+------------------------------
Unfortunately dynamic_cast<>() can return zero if the cast fails. In
mythui the member function MythMainWindow::eventFilter receives an event
from the QT event system and dynamic_cast<>() it to the key event that
MythTV needs. It is highly unlikely that this event will not be a key
event. But if it weren't then the dyncast would fail and give a null
pointer. Meaning that in a few more lines when the pointer is
dereferenced, down the drain we would go.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/4742>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list