From 98cf7063dfda2e4958145c5b0f25d91200270864 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 13 Aug 2018 17:14:50 +0100 Subject: ofz: Integer-overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4f5e133195b46839da96952952ad119855dfbddf Reviewed-on: https://gerrit.libreoffice.org/58948 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- svtools/source/svhtml/parhtml.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'svtools') diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 71aa5acd7620..fa31a1271d95 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -2027,7 +2028,10 @@ bool HTMLParser::ParseMetaOptionsImpl( if (comphelper::string::getTokenCount(aContent, ';') == 2) { Date aDate(aContent.getToken(0, ';').toInt32()); - tools::Time aTime(aContent.getToken(1, ';').toInt64()); + auto nTime = aContent.getToken(1, ';').toInt64(); + if (nTime < 0) + nTime = o3tl::saturating_toggle_sign(nTime); + tools::Time aTime(nTime); DateTime aDateTime(aDate, aTime); uDT = aDateTime.GetUNODateTime(); valid = true; -- cgit