mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 23:13:13 +02:00
lib/libupnpclient fix segfault if parser is NULL
This commit is contained in:
@@ -170,6 +170,9 @@ CUPnPDevice::CUPnPDevice(std::string url)
|
|||||||
throw std::runtime_error(std::string("description url returned ") + rcode);
|
throw std::runtime_error(std::string("description url returned ") + rcode);
|
||||||
|
|
||||||
xmlDocPtr parser = parseXml(body.c_str(),charset.c_str());
|
xmlDocPtr parser = parseXml(body.c_str(),charset.c_str());
|
||||||
|
if(!parser)
|
||||||
|
throw std::runtime_error(std::string("XML: parser error"));
|
||||||
|
|
||||||
root = xmlDocGetRootElement(parser);
|
root = xmlDocGetRootElement(parser);
|
||||||
if (!root)
|
if (!root)
|
||||||
throw std::runtime_error(std::string("XML: no root node"));
|
throw std::runtime_error(std::string("XML: no root node"));
|
||||||
|
@@ -99,6 +99,9 @@ std::list<UPnPAttribute> CUPnPService::SendSOAP(std::string action, std::list<UP
|
|||||||
throw std::runtime_error(std::string("protocol error"));
|
throw std::runtime_error(std::string("protocol error"));
|
||||||
|
|
||||||
xmlDocPtr parser = parseXml(body.c_str(),charset.c_str());
|
xmlDocPtr parser = parseXml(body.c_str(),charset.c_str());
|
||||||
|
if(!parser)
|
||||||
|
throw std::runtime_error(std::string("XML: parser error"));
|
||||||
|
|
||||||
root = xmlDocGetRootElement(parser);
|
root = xmlDocGetRootElement(parser);
|
||||||
if (!root)
|
if (!root)
|
||||||
throw std::runtime_error(std::string("XML: no root node"));
|
throw std::runtime_error(std::string("XML: no root node"));
|
||||||
|
Reference in New Issue
Block a user