Bug 791278: Protect PeerConnection setLocal/RemoteDescription from NULL input r=jesup
authorEthan Hugg <ethanhugg@gmail.com>
Tue, 09 Oct 2012 15:14:51 -0700
changeset 109844 7e871133c6076341efb495d03013da4de89d19c7
parent 109843 25a66981bdb06a2c746737c3d87a5e75153c948f
child 109845 6c7c155557df8a76318575b59ac672e5da25060f
push id23657
push useremorley@mozilla.com
push dateThu, 11 Oct 2012 13:47:00 +0000
treeherdermozilla-central@2fae8bd461da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjesup
bugs791278
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 791278: Protect PeerConnection setLocal/RemoteDescription from NULL input r=jesup
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -697,27 +697,33 @@ PeerConnectionImpl::CreateAnswer(const c
   CheckIceState();
   mRole = kRoleAnswerer;  // TODO(ekr@rtfm.com): Interrogate SIPCC here?
   mCall->createAnswer(aHints, aOffer);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PeerConnectionImpl::SetLocalDescription(int32_t aAction, const char* aSDP) {
-  MOZ_ASSERT(aSDP);
+  if (!aSDP) {
+    CSFLogError(logTag, "%s - aSDP is NULL", __FUNCTION__);
+    return NS_ERROR_FAILURE;
+  }
 
   CheckIceState();
   mLocalRequestedSDP = aSDP;
   mCall->setLocalDescription((cc_jsep_action_t)aAction, mLocalRequestedSDP);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP) {
-  MOZ_ASSERT(aSDP);
+  if (!aSDP) {
+    CSFLogError(logTag, "%s - aSDP is NULL", __FUNCTION__);
+    return NS_ERROR_FAILURE;
+  }
 
   CheckIceState();
   mRemoteRequestedSDP = aSDP;
   mCall->setRemoteDescription((cc_jsep_action_t)action, mRemoteRequestedSDP);
   return NS_OK;
 }
 
 NS_IMETHODIMP