Bug 791278: Protect PeerConnection setLocal/RemoteDescription from NULL input r=jesup

This commit is contained in:
Ethan Hugg 2012-10-09 15:14:51 -07:00
Родитель f9dda29b0b
Коммит f7560ac779
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -702,7 +702,10 @@ PeerConnectionImpl::CreateAnswer(const char* aHints, const char* aOffer) {
NS_IMETHODIMP NS_IMETHODIMP
PeerConnectionImpl::SetLocalDescription(int32_t aAction, const char* aSDP) { 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(); CheckIceState();
mLocalRequestedSDP = aSDP; mLocalRequestedSDP = aSDP;
@ -712,7 +715,10 @@ PeerConnectionImpl::SetLocalDescription(int32_t aAction, const char* aSDP) {
NS_IMETHODIMP NS_IMETHODIMP
PeerConnectionImpl::SetRemoteDescription(int32_t action, const char* aSDP) { 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(); CheckIceState();
mRemoteRequestedSDP = aSDP; mRemoteRequestedSDP = aSDP;