diff --git a/src/conference/handlers/local-conference-list-event-handler.cpp b/src/conference/handlers/local-conference-list-event-handler.cpp index 95675250c318983027ae16784e9448ee216deffe..0a2fdc4f075b44c411c62b458a0e546dd0c75671 100644 --- a/src/conference/handlers/local-conference-list-event-handler.cpp +++ b/src/conference/handlers/local-conference-list-event-handler.cpp @@ -108,10 +108,17 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con bool noContent = true; list<Content> contents; istringstream data(xmlBody); - unique_ptr<Xsd::ResourceLists::ResourceLists> rl(Xsd::ResourceLists::parseResourceLists( - data, - Xsd::XmlSchema::Flags::dont_validate - )); + unique_ptr<Xsd::ResourceLists::ResourceLists> rl; + try { + rl = Xsd::ResourceLists::parseResourceLists( + data, + Xsd::XmlSchema::Flags::dont_validate + ); + } catch (const exception &) { + lError() << "Error while parsing subscribe body for conferences asked by: " << participantAddr; + return; + } + for (const auto &l : rl->getList()) { for (const auto &entry : l.getEntry()) { Address addr(entry.getUri()); diff --git a/src/conference/handlers/remote-conference-event-handler.cpp b/src/conference/handlers/remote-conference-event-handler.cpp index 7f265116f50faafd72e4570f5fad4d6710ff38e8..b9a1a8758dceafd8a987514051e3fc47b13211ad 100644 --- a/src/conference/handlers/remote-conference-event-handler.cpp +++ b/src/conference/handlers/remote-conference-event-handler.cpp @@ -46,7 +46,13 @@ using namespace Xsd::ConferenceInfo; void RemoteConferenceEventHandlerPrivate::simpleNotifyReceived (const string &xmlBody) { istringstream data(xmlBody); - unique_ptr<ConferenceType> confInfo = parseConferenceInfo(data, Xsd::XmlSchema::Flags::dont_validate); + unique_ptr<ConferenceType> confInfo; + try { + confInfo = parseConferenceInfo(data, Xsd::XmlSchema::Flags::dont_validate); + } catch (const exception &) { + lError() << "Error while parsing conference notify for: " << conferenceId; + return; + } IdentityAddress entityAddress(confInfo->getEntity().c_str()); if (entityAddress != conferenceId.getPeerAddress()) diff --git a/src/conference/handlers/remote-conference-list-event-handler.cpp b/src/conference/handlers/remote-conference-list-event-handler.cpp index f4edbc6c408b0ab7069754dcaeb7860f149cbb46..ab823858b575d41def96a5b5f09b4780cfba868e 100644 --- a/src/conference/handlers/remote-conference-list-event-handler.cpp +++ b/src/conference/handlers/remote-conference-list-event-handler.cpp @@ -139,7 +139,16 @@ void RemoteConferenceListEventHandler::notifyReceived (const Content *notifyCont // Simple notify received directly from a chat-room const string &xmlBody = notifyContent->getBodyAsUtf8String(); istringstream data(xmlBody); - unique_ptr<Xsd::ConferenceInfo::ConferenceType> confInfo = Xsd::ConferenceInfo::parseConferenceInfo(data, Xsd::XmlSchema::Flags::dont_validate); + unique_ptr<Xsd::ConferenceInfo::ConferenceType> confInfo; + try { + confInfo = Xsd::ConferenceInfo::parseConferenceInfo( + data, + Xsd::XmlSchema::Flags::dont_validate + ); + } catch (const exception &) { + lError() << "Error while parsing conference-info in conferences notify"; + return; + } IdentityAddress entityAddress(confInfo->getEntity().c_str()); ConferenceId id(entityAddress, local); @@ -210,11 +219,17 @@ void RemoteConferenceListEventHandler::removeHandler (RemoteConferenceEventHandl map<string, IdentityAddress> RemoteConferenceListEventHandler::parseRlmi (const string &xmlBody) const { istringstream data(xmlBody); - unique_ptr<Xsd::Rlmi::List> rlmi(Xsd::Rlmi::parseList( - data, - Xsd::XmlSchema::Flags::dont_validate - )); map<string, IdentityAddress> addresses; + unique_ptr<Xsd::Rlmi::List> rlmi; + try { + rlmi = Xsd::Rlmi::parseList( + data, + Xsd::XmlSchema::Flags::dont_validate + ); + } catch (const exception &) { + lError() << "Error while parsing RLMI in conferences notify"; + return addresses; + } for (const auto &resource : rlmi->getResource()) { if (resource.getInstance().empty()) continue;