diff --git a/CHANGELOG.md b/CHANGELOG.md index d06d2eb981..07485a26e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog +### 2.0.13 + +* Avoid crash when no remote IP/port is given. + + ### 2.0.12 * Add `handled` and `unhandled` events to `Consumer`. diff --git a/package.json b/package.json index 6dfb11862f..ffb72f9534 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mediasoup", - "version": "2.0.12", + "version": "2.0.13", "description": "Cutting Edge WebRTC Video Conferencing", "author": "IƱaki Baz Castillo (https://inakibaz.me)", "contributors": [ diff --git a/worker/src/RTC/Router.cpp b/worker/src/RTC/Router.cpp index 23fb9d6eef..5908933ec9 100644 --- a/worker/src/RTC/Router.cpp +++ b/worker/src/RTC/Router.cpp @@ -257,12 +257,21 @@ namespace RTC RTC::PlainRtpTransport::Options options; if (!request->data[JsonStringRemoteIP].isString()) - MS_THROW_ERROR("missing remoteIP"); + { + request->Reject("missing remoteIP"); + + return; + } options.remoteIP = request->data[JsonStringRemoteIP].asString(); if (!request->data[JsonStringRemotePort].isUInt()) - MS_THROW_ERROR("missing remotePort"); + { + request->Reject("missing remotePort"); + + return; + } + options.remotePort = request->data[JsonStringRemotePort].asUInt(); RTC::PlainRtpTransport* plainRtpTransport; @@ -849,12 +858,20 @@ namespace RTC RTC::Transport::MirroringOptions options; if (!request->data[JsonStringRemoteIP].isString()) - MS_THROW_ERROR("missing remoteIP"); + { + request->Reject("missing remoteIP"); + + return; + } options.remoteIP = request->data[JsonStringRemoteIP].asString(); if (!request->data[JsonStringRemotePort].isUInt()) - MS_THROW_ERROR("missing remotePort"); + { + request->Reject("missing remotePort"); + + return; + } options.remotePort = request->data[JsonStringRemotePort].asUInt();