summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-06-30 23:49:03 +0200
committerEike Rathke <erack@redhat.com>2022-07-01 00:48:15 +0200
commitd031accf712cde8f664828ec4547bf6a4661860f (patch)
tree28ab268136865804b5aa6b83349b28f387c5617c /xmloff
parent8480e15f854cfc0a6b99a6b28f794465d0fb8253 (diff)
Check sax::Converter::parseDateTime() success return value
Change-Id: Ia843a1437a8c97e2dafc3f22d43a3dc61873269b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136686 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLCalculationSettingsContext.cxx6
-rw-r--r--xmloff/source/core/DocumentSettingsContext.cxx6
2 files changed, 8 insertions, 4 deletions
diff --git a/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx b/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx
index 9365a791c901..fbe54c96d0f8 100644
--- a/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx
+++ b/xmloff/source/chart/SchXMLCalculationSettingsContext.cxx
@@ -44,8 +44,10 @@ SchXMLCalculationSettingsContext::SchXMLCalculationSettingsContext( SvXMLImport&
if ( aIter.getToken() == XML_ELEMENT(TABLE, XML_DATE_VALUE) )
{
util::DateTime aNullDate;
- ::sax::Converter::parseDateTime(aNullDate, aIter.toView());
- m_aNullDate <<= aNullDate;
+ if (::sax::Converter::parseDateTime(aNullDate, aIter.toView()))
+ m_aNullDate <<= aNullDate;
+ else
+ SAL_WARN("xmloff", "SchXMLCalculationSettingsContext: broken DateTime '" << aIter.toView() << "'");
}
else
XMLOFF_WARN_UNKNOWN("xmloff", aIter);
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index b21010b07c81..9052a8dbaa81 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -462,8 +462,10 @@ void XMLConfigItemContext::endFastElement(sal_Int32 )
else if (IsXMLToken(msType, XML_DATETIME))
{
util::DateTime aDateTime;
- ::sax::Converter::parseDateTime(aDateTime, sValue);
- mrAny <<= aDateTime;
+ if (::sax::Converter::parseDateTime(aDateTime, sValue))
+ mrAny <<= aDateTime;
+ else
+ SAL_WARN("xmloff.core", "XMLConfigItemContext: broken DateTime '" << sValue << "'");
}
else if (IsXMLToken(msType, XML_BASE64BINARY))
{