Changes between Initial Version and Version 1 of Ticket #3446


Ignore:
Timestamp:
May 6, 2014, 1:53:39 PM (6 years ago)
Author:
stephen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3446

    • Property Summary changed from Unitialized scalar field in Thread::Impl constructor to Unitialized member variables in constructors
  • Ticket #3446 – Description

    initial v1  
    1 Coverity reports an unitialized member variable in the constructor of Thread::Impl in src/lib/util/threads/thread.cc (CID 1202723):
     1Three Coverity-detected unitialized member variable issues:
     2
     31) In the constructor of Thread::Impl in src/lib/util/threads/thread.cc (CID 1202723):
    24{{{
    35 44class Thread::Impl {
     
    1416}}}
    1517All that is needed is the addition of {{{tid_(0)}}} after the initialization of "exception_".
     18
     192) In the constructor of NAPTRImpl in src/lib/dns/dataclass.cc (CID 1202726):
     20{{{
     212555class NAPTRImpl {
     222556public:
     23   
     242. uninit_member: Non-static class member order is not initialized in this constructor nor in any functions that it calls.
     25   
     26CID 1202726 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)4. uninit_member: Non-static class member preference is not initialized in this constructor nor in any functions that it calls.
     272557    NAPTRImpl() : replacement(".") {}
     28}}}
     29("order" and "preference" are both uint16_t, and could be initialized to 0.)
     30
     313) In the constructor of SocketSessionForwarded::ForwarderImpl in src/lib/util/io/socketsession.cc (CID 1202727):
     32{{{
     33 86struct SocketSessionForwarder::ForwarderImpl {
     34   
     352. uninit_member: Non-static class member field sock_un_.sun_family is not initialized in this constructor nor in any functions that it calls.
     36   
     37CID 1202727 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR)4. uninit_member: Non-static class member sock_un_len_ is not initialized in this constructor nor in any functions that it calls.
     38 87    ForwarderImpl() : fd_(-1), buf_(DEFAULT_HEADER_BUFLEN) {}
     39 88    struct sockaddr_un sock_un_;
     40   
     413. member_decl: Class member declaration for sock_un_len_.
     42 89    socklen_t sock_un_len_;
     43}}}
     44Both these variables should be zeroed.