From 59f29dd735bf5890ea29fdde809afcf111463a65 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 12 Mar 2018 20:33:54 +0100 Subject: [PATCH] fix null ptr deref. if decryption failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Antti Levomäki and Christian Jalio from Forcepoint. --- src/lib/StarObjectDraw.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/StarObjectDraw.cxx b/src/lib/StarObjectDraw.cxx index fd3411a..8a19b1c 100644 --- a/src/lib/StarObjectDraw.cxx +++ b/src/lib/StarObjectDraw.cxx @@ -199,10 +199,11 @@ try if the user mask does correspond to the real mask. */ input=StarEncryption::decodeStream(input, StarEncryption::getMaskToDecodeStream(firstByte, 0x44)); - if (input) { - zone.setInput(input); - input->seek(0, librevenge::RVNG_SEEK_SET); + if (!input) { + STOFF_DEBUG_MSG(("StarObjectDraw::readDrawDocument: decryption failed\n")); + return false; } + zone.setInput(input); } input->seek(0, librevenge::RVNG_SEEK_SET); std::shared_ptr model(new StarObjectModel(*this, true)); -- 2.14.3