[Libreoffice-commits] .: Branch 'libreoffice-3-4' - unoxml/source
Petr Mladek
pmladek at kemper.freedesktop.org
Thu Apr 28 08:58:22 PDT 2011
unoxml/source/dom/node.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 4022fed414a33c4641fe6ada02956768f86c74bb
Author: Radek Doulik <rodo at novell.com>
Date: Thu Apr 28 17:57:31 2011 +0200
unoxml-fix-empty-xmlns.diff: crasher in xml parser
diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx
index f32e443..cbfbf4f 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)),
More information about the Libreoffice-commits
mailing list