iOS Crash on SetRemote/LocalDescription

113 views
Skip to first unread message

Minhyuk Kim

unread,
Sep 4, 2021, 8:36:17 AM9/4/21
to discuss-webrtc
In the latest release of iOS SDK, the SDK crashs with `exc_bad_access` when setting remote/local description with invalid session description. 
This is caused by `sdp.nativeDescription->Clone()` in RTCPeerConnection.mm:600
```
_peerConnection->SetRemoteDescription(sdp.nativeDescription->Clone(), observer);
```

When an invalid session description is provided, the return value of `sdp.nativeDescription` is nullptr, and trying to call `Clone()` on it results in a bad access crash. 

This can be fixed by changing the code to something like: 
```
_peerConnection->SetRemoteDescription(sdp.nativeDescription ? sdp.nativeDescription->Clone() : nullptr, observer);
```

I found this out during stress testing. While the session description should be valid at all times, I think having it safely disregarded is better than simply crashing the app. 

It's my first time posting here; is there a good way to go about suggesting a fix for this?

Philipp Hancke

unread,
Sep 4, 2021, 8:47:52 AM9/4/21
to discuss...@googlegroups.com

--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/a5594a4d-e334-42b7-a5ac-f83da92484e5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages