lib/libupnpclient fix segfault if parser is NULL

Origin commit data
------------------
Branch: ni/coolstream
Commit: e6e8eb9d93
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2015-06-28 (Sun, 28 Jun 2015)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2015-06-28 15:13:14 +02:00
parent 755209ea54
commit 7f9eb2d789
2 changed files with 6 additions and 0 deletions

View File

@@ -170,6 +170,9 @@ CUPnPDevice::CUPnPDevice(std::string url)
throw std::runtime_error(std::string("description url returned ") + rcode);
xmlDocPtr parser = parseXml(body.c_str(),charset.c_str());
if(!parser)
throw std::runtime_error(std::string("XML: parser error"));
root = xmlDocGetRootElement(parser);
if (!root)
throw std::runtime_error(std::string("XML: no root node"));

View File

@@ -99,6 +99,9 @@ std::list<UPnPAttribute> CUPnPService::SendSOAP(std::string action, std::list<UP
throw std::runtime_error(std::string("protocol error"));
xmlDocPtr parser = parseXml(body.c_str(),charset.c_str());
if(!parser)
throw std::runtime_error(std::string("XML: parser error"));
root = xmlDocGetRootElement(parser);
if (!root)
throw std::runtime_error(std::string("XML: no root node"));