Skip to content

Commit

Permalink
Initialize fd_set in MythSystemLegacyIOHandler ctor
Browse files Browse the repository at this point in the history
Static analysis detected that the fd_set was not
being initialized in the ctor.  While correct
from a static analysis POV, the structure was
being initialized elsewhere before use.  To
make static analysis happy, initialize the fd_set.

Fixes coverity 1028698

Note that coverity may not properly understand
that the use of the provided FD_ZERO macro will
properly initialize the structure since on
some platforms (i.e. x86) the macro turns into
inline assembly code.  In the case that adding
the patch does not eliminate the coverity issue,
one will need to manually acknowledge the defect.

Fixes #11625.

Signed-off-by: Paul Harrison <pharrison@mythtv.org>
  • Loading branch information
garybuhrmaster authored and Paul Harrison committed Jul 1, 2013
1 parent 386819e commit b37d3cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mythtv/libs/libmythbase/mythsystemunix.cpp
Expand Up @@ -80,6 +80,7 @@ MythSystemLegacyIOHandler::MythSystemLegacyIOHandler(bool read) :
m_pWaitLock(), m_pWait(), m_pLock(), m_pMap(PMap_t()), m_maxfd(-1),
m_read(read)
{
FD_ZERO(&m_fds);
m_readbuf[0] = '\0';
}

Expand Down

0 comments on commit b37d3cf

Please sign in to comment.