From cff30e58bf33d693c508a7af71f9f1c8adc58c03 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Thu, 28 Apr 2011 17:57:31 +0200 Subject: unoxml-fix-empty-xmlns.diff: crasher in xml parser --- unoxml/source/dom/node.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'unoxml') diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index 7ab6336aefdf..b4645bc0b578 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -87,8 +87,9 @@ namespace DOM // add node's namespaces to current context for (xmlNsPtr pNs = pNode->nsDef; pNs != 0; pNs = pNs->next) { const xmlChar *pPrefix = pNs->prefix; + // prefix can be NULL when xmlns attribute is empty (xmlns="") OString prefix(reinterpret_cast(pPrefix), - strlen(reinterpret_cast(pPrefix))); + pPrefix ? strlen(reinterpret_cast(pPrefix)) : 0); const xmlChar *pHref = pNs->href; OUString val(reinterpret_cast(pHref), strlen(reinterpret_cast(pHref)), -- cgit