From 87b26787804cf1839d1eefd54854e647f716d934 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 14 Aug 2018 08:40:05 +0100 Subject: abandon import on bad entry Change-Id: I86a48eec43505966bca03aca947ab4d67de41e60 Reviewed-on: https://gerrit.libreoffice.org/58967 Reviewed-by: Stephan Bergmann Tested-by: Jenkins --- lotuswordpro/source/filter/lwpobjstrm.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx b/lotuswordpro/source/filter/lwpobjstrm.cxx index b1b9744da682..4ac9fd11d6a5 100644 --- a/lotuswordpro/source/filter/lwpobjstrm.cxx +++ b/lotuswordpro/source/filter/lwpobjstrm.cxx @@ -57,7 +57,6 @@ #include #include -#include #include #include #include @@ -372,11 +371,9 @@ OUString LwpObjectStream::QuickReadStringPtr() QuickReaduInt16(); //len OUString str; - if (diskSize >= sizeof diskSize) { - LwpTools::QuickReadUnicode(this, str, diskSize-sizeof(diskSize), RTL_TEXTENCODING_MS_1252); - } else { - SAL_WARN("lwp", "Too small size " << diskSize); - } + if (diskSize < sizeof diskSize) + throw std::range_error("Too small size"); + LwpTools::QuickReadUnicode(this, str, diskSize-sizeof(diskSize), RTL_TEXTENCODING_MS_1252); return str; } -- cgit