Opened 12 years ago

Closed 12 years ago

#4744 closed defect (fixed)

null pointer check comes too late in MediaMonitorUnix::AddDevice

Reported by: Erik Hovland <erik@…> Owned by: Isaac Richards
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

In MediaMonitorUnix::AddDevice? in libs/libmyth/mediamonitor-unix.cpp there is a check to make sure that the fstab struct pointer it was handed is not null. But the check comes after the pointer was dereferenced.

Attachments (1)

libs_libmyth_mediamonitor-unix.cpp-fix-null-check-too-late.patch (941 bytes) - added by Erik Hovland <erik@…> 12 years ago.
Moves the check for null pointer before the pointer is dereferenced

Download all attachments as: .zip

Change History (2)

Changed 12 years ago by Erik Hovland <erik@…>

Moves the check for null pointer before the pointer is dereferenced

comment:1 Changed 12 years ago by danielk

Resolution: fixed
Status: newclosed

(In [16208]) Fixes #4744. Moves a null pointer check to a slightly earlier point in MediaMonitorUnix::AddDevice?() so we don't try to dereference it before NULL check (looks like it was moved to a bad location for a now commented out debug statement..)

Note: See TracTickets for help on using tickets.