summaryrefslogtreecommitdiff
path: root/svtools/source/svhtml/parhtml.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-13 17:14:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-08-13 22:14:18 +0200
commit98cf7063dfda2e4958145c5b0f25d91200270864 (patch)
tree95d4e74c5d2d27de260960245a933b8d9b94c3f9 /svtools/source/svhtml/parhtml.cxx
parent364b559e2e090824d304e816827e12ba34539994 (diff)
ofz: Integer-overflow
Change-Id: I4f5e133195b46839da96952952ad119855dfbddf Reviewed-on: https://gerrit.libreoffice.org/58948 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools/source/svhtml/parhtml.cxx')
-rw-r--r--svtools/source/svhtml/parhtml.cxx6
1 files changed, 5 insertions, 1 deletions
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 <comphelper/string.hxx>
+#include <o3tl/safeint.hxx>
#include <tools/stream.hxx>
#include <tools/debug.hxx>
#include <tools/color.hxx>
@@ -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;