diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-12-20 12:58:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-20 15:56:45 +0000 |
commit | e6593922d026ab7adbdb88084637b2e018af88c9 (patch) | |
tree | 0649c9e0df80745ac1bcbede9a600fc2a1c56986 /oox | |
parent | be0331a93e7691c7d5c4ebbfffe59af83ea3be7a (diff) |
crashtesting: assert on import of forum-mso-en4-253564.xlsx
source document contains a timestamp formatted as:
2011-010-31T00: 00:00Z
^^^
Change-Id: I604ffa69189280faf9d7f55dae472cf9fe1b6763
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144601
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/attributelist.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/oox/source/helper/attributelist.cxx b/oox/source/helper/attributelist.cxx index 49ff32a967f5..037483cefb5a 100644 --- a/oox/source/helper/attributelist.cxx +++ b/oox/source/helper/attributelist.cxx @@ -263,7 +263,10 @@ std::optional< util::DateTime > AttributeList::getDateTime( sal_Int32 nAttrToken (aValue[ 4 ] == '-') && (aValue[ 7 ] == '-') && (aValue[ 10 ] == 'T') && (aValue[ 13 ] == ':') && (aValue[ 16 ] == ':'); if (!bValid) + { + SAL_WARN("oox", "bad date string: " << aValue); return std::optional< util::DateTime >(); + } aDateTime.Year = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.substr( 0, 4 )) ); aDateTime.Month = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.substr( 5, 2 )) ); aDateTime.Day = static_cast< sal_uInt16 >( o3tl::toInt32(aValue.substr( 8, 2 )) ); |