----- Original Message -----
> From: "Werner Dittmann" <[email protected]>
> To: [email protected]
> Sent: Monday, April 30, 2012 3:11:37 AM
> Subject: Re: [Ccrtp-devel] CryptoContext: uninitialized value
> 
> 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.

In that case, could the attached patch be applied?

Best,
Tristan

> 
> 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
> > 
> 
> 
> _______________________________________________
> Ccrtp-devel mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/ccrtp-devel
> 
From 6ddf285101ee52c13e2c5d551a7ffe9709a937bf Mon Sep 17 00:00:00 2001
From: Tristan Matthews <[email protected]>
Date: Fri, 27 Apr 2012 15:25:34 -0400
Subject: [PATCH 1/1] Default initialize macCtx to NULL

---
 src/CryptoContext.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/CryptoContext.cpp b/src/CryptoContext.cpp
index 9396462..852c537 100644
--- a/src/CryptoContext.cpp
+++ b/src/CryptoContext.cpp
@@ -51,7 +51,7 @@ master_salt(NULL), master_salt_length(0),
 n_e(0),k_e(NULL),n_a(0),k_a(NULL),n_s(0),k_s(NULL),
 ealg(SrtpEncryptionNull), aalg(SrtpAuthenticationNull),
 ekeyl(0), akeyl(0), skeyl(0),
-seqNumSet(false), cipher(NULL), f8Cipher(NULL)
+seqNumSet(false), macCtx(NULL), cipher(NULL), f8Cipher(NULL)
 {}
 
 #ifdef SRTP_SUPPORT
@@ -73,7 +73,7 @@ ssrcCtx(ssrc),using_mki(false),mkiLength(0),mki(NULL),
 roc(roc),guessed_roc(0),s_l(0),key_deriv_rate(key_deriv_rate),
 replay_window(0),
 master_key_srtp_use_nb(0), master_key_srtcp_use_nb(0), seqNumSet(false),
-cipher(NULL), f8Cipher(NULL)
+macCtx(NULL), cipher(NULL), f8Cipher(NULL)
 {
     this->ealg = ealg;
     this->aalg = aalg;
-- 
1.7.5.4

_______________________________________________
Ccrtp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/ccrtp-devel

Reply via email to