inspircd / inspircd

A modular C++ IRC server (ircd).

Home Page:https://www.inspircd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Valgrind detected uninitialised SSLIOHook::status

shaggie76 opened this issue · comments

Description

I was running under valgrind to see if I could find a bug in our module but it something unrelated:

==101732== Conditional jump or move depends on uninitialised value(s)
==101732==    at 0x531F77B: SSLInfoCallback (m_ssl_openssl.cpp:717)
==101732==    by 0x531F77B: StaticSSLInfoCallback(ssl_st const*, int, int) (m_ssl_openssl.cpp:932)
==101732==    by 0x537AD34: ??? (in /usr/lib/x86_64-linux-gnu/libssl.so.1.1)
==101732==    by 0x5366D97: SSL_do_handshake (in /usr/lib/x86_64-linux-gnu/libssl.so.1.1)
==101732==    by 0x53224C3: Handshake (m_ssl_openssl.cpp:603)
==101732==    by 0x53224C3: OpenSSLIOHook (m_ssl_openssl.cpp:777)
==101732==    by 0x53224C3: OpenSSLIOHookProvider::OnAccept(StreamSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) (m_ssl_openssl.cpp:1000)
==101732==    by 0x1A7755: UserManager::AddUser(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) (usermanager.cpp:170)
==101732==    by 0x1793F4: ListenSocket::OnEventHandlerRead() (listensocket.cpp:214)
==101732==    by 0x1BCCBD: SocketEngine::DispatchEvents() (socketengine_epoll.cpp:214)
==101732==    by 0x16FCC8: InspIRCd::Run() (inspircd.cpp:700)
==101732==    by 0x13C679: main (inspircd.cpp:730)

I believe it's complaining about SSLIOHook::status not being initialized by the constructor. I seem to get this every time I get a connection.

I'm running InspIRCd-3.14.0 still but I checked and https://github.com/inspircd/inspircd/blob/master/include/modules/ssl.h is unchanged.

Adding to the constructor seems to fix:

        SSLIOHook(IOHookProvider* hookprov)
!               : IOHook(hookprov)
        {
--- 222,224 ----
        SSLIOHook(IOHookProvider* hookprov)
!               : IOHook(hookprov), status(STATUS_NONE)
        {

Fixed in Git, thanks for reporting!