Opened 18 years ago
Closed 18 years ago
#4742 closed defect (invalid)
dyncast can return zero. Resulting pointer should be checked in mythui
| Reported by: | Owned by: | stuartm | |
|---|---|---|---|
| Priority: | trivial | Milestone: | 0.21 |
| Component: | mythtv | Version: | head |
| Severity: | low | Keywords: | |
| Cc: | Ticket locked: | no |
Description
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.
Attachments (1)
Change History (3)
comment:1 by , 18 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
by , 18 years ago
| Attachment: | check-dyncast-in-mythmainwindow.patch added |
|---|
comment:2 by , 18 years ago
| Resolution: | → invalid |
|---|---|
| Status: | assigned → closed |
That's the point of having the type enum in QEvent.
Note:
See TracTickets
for help on using tickets.

Checks dyncast for null in mythui