Re: CryptoContext: uninitialized value

Werner Dittmann <[email protected]> Mon, 30 Apr 2012 09:11:37 +0200
Newsgroups gmane.comp.gnu.ccrtp.devel
Message-ID <[email protected]>
Initialization to NULL is correct. In case of non-authentication mode this could
lead to problems if macCtx contains some random value and delete uses this value
to free the macCtx.

This problem did not show up because SRTP usually uses an authentication mode and
macCtx was initialized eventually. Note: SRTP shall always use an authentication.

Regards,
Werner

Am 30.04.2012 03:45, schrieb Tristan Matthews:
> [Apologies for cross-posting...accidentally mailed this to bug-commoncpp]
> 
> I was just wondering if macCtx in CryptoCtx is deliberately _not_ initialized in either of CryptoContext's constructors.
> I ask because this value is used in an if-statement in the destructor for CryptoContext (see CryptoContext.cpp:180).
> Note that the body of the if-statement checks against initialized values before doing any work, so the current code is harmless.
> 
> Best,
> Tristan
>