Fixed a bug that copied without considering the length of xmlChar

This commit is contained in:
Takeshi Nakatani 2021-10-26 11:32:17 +00:00 committed by Andrew Gaul
parent 72a9f40f3f
commit 7892eee207

View File

@ -52,7 +52,10 @@ static bool GetXmlNsUrl(xmlDocPtr doc, std::string& nsurl)
xmlNsPtr* nslist = xmlGetNsList(doc, pRootNode);
if(nslist){
if(nslist[0] && nslist[0]->href){
strNs = (const char*)(nslist[0]->href);
int len = xmlStrlen(nslist[0]->href);
if(0 < len){
strNs = std::string((const char*)(nslist[0]->href), len);
}
}
S3FS_XMLFREE(nslist);
}