From 30095b3c0b84e85caf253a27e41254eaf35e4ca7 Mon Sep 17 00:00:00 2001 From: Eduardo Mendi Date: Tue, 15 Apr 2014 17:29:52 +0200 Subject: Fix KW10 issues BZ: 186081 Due to upgrade klocwork (KW version from 9.6 to 10.0) new issues have been raised. This patch fix the new issues raised in PFW. Change-Id: I54c14e4d6da1c9a5f8d82aec1769a9e7e948db50 Signed-off-by: Eduardo Mendi --- xmlserializer/XmlElement.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xmlserializer') diff --git a/xmlserializer/XmlElement.cpp b/xmlserializer/XmlElement.cpp index d0ab91a..bda3973 100644 --- a/xmlserializer/XmlElement.cpp +++ b/xmlserializer/XmlElement.cpp @@ -86,6 +86,9 @@ string CXmlElement::getAttributeString(const string &strAttributeName) const return ""; } xmlChar* pucXmlValue = xmlGetProp((xmlNode*)_pXmlElement, (const xmlChar*)strAttributeName.c_str()); + if (pucXmlValue == NULL) { + return ""; + } string strValue((const char*)pucXmlValue); @@ -130,6 +133,9 @@ double CXmlElement::getAttributeDouble(const string &strAttributeName) const string CXmlElement::getTextContent() const { xmlChar* pucXmlContent = xmlNodeGetContent(_pXmlElement); + if (pucXmlContent == NULL) { + return ""; + } string strContent((const char*)pucXmlContent); -- cgit v1.1