summaryrefslogtreecommitdiff
path: root/unoxml
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2011-04-28 17:57:31 +0200
committerPetr Mladek <pmladek@suse.cz>2011-04-28 17:57:31 +0200
commitcff30e58bf33d693c508a7af71f9f1c8adc58c03 (patch)
treea02a99e22b0d31e6f1b3765c1b1dca878f66e4af /unoxml
parent79d86e900ae38aaf530be9ceb0f54ee4943d38f0 (diff)
unoxml-fix-empty-xmlns.diff: crasher in xml parser
Diffstat (limited to 'unoxml')
-rw-r--r--unoxml/source/dom/node.cxx3
1 files changed, 2 insertions, 1 deletions
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<const sal_Char*>(pPrefix),
- strlen(reinterpret_cast<const char*>(pPrefix)));
+ pPrefix ? strlen(reinterpret_cast<const char*>(pPrefix)) : 0);
const xmlChar *pHref = pNs->href;
OUString val(reinterpret_cast<const sal_Char*>(pHref),
strlen(reinterpret_cast<const char*>(pHref)),