From 73cd2cf7d1707e464f13c28b6ec583c484fd3f46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jan 2018 11:09:54 +0000 Subject: [PATCH] ofz#4940 Null-dereference READ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2c8c83ef6ffde5f1599814538acc36ec5beab6c8 Reviewed-on: https://gerrit.libreoffice.org/47387 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- unoxml/source/dom/element.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index fa4ef9ce4670..f7cae19fdbdc 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -132,7 +132,7 @@ namespace DOM RTL_TEXTENCODING_UTF8)); } - const xmlChar* pPrefix = m_aNodePtr->ns ? m_aNodePtr->ns->prefix : reinterpret_cast(""); + const xmlChar* pPrefix = (m_aNodePtr->ns && m_aNodePtr->ns->prefix) ? m_aNodePtr->ns->prefix : reinterpret_cast(""); const xmlChar* pName = m_aNodePtr->name; sal_Int32 nElementToken=FastToken::DONTKNOW; if( strlen(reinterpret_cast(pPrefix)) ) -- 2.18.1