[Live-devel] Bug fix: Missing member initialization in TLSState

Horst Possegger possegger at icg.tugraz.at
Wed Jan 22 15:39:26 PST 2020


Hi,

TLSState::reset() may cause a segmentation fault because not all members
of TLSState are properly initialized.
In particular, lines 26-28 of liveMedia/TLSState.cpp (version
2020.01.19) should initialize "fCon" and "fCtx", too:

#ifndef NO_OPENSSL
   , fClient(client), fHasBeenSetup(False), fCon(NULL), fCtx(NULL)
#endif

Otherwise, the SSL_free/SSL_CTX_free calls in TLSState::reset() (lines
85 and 86) would access invalid memory locations.
I've experienced this segfault today and tracked it down via valgrind.
Initialization as above fixes this bug. Please add the initialization to 
the live555 code base.

Best regards,
Horst


More information about the live-devel mailing list