[Libreoffice-commits] core.git: vcl/workben

Caolán McNamara caolanm at redhat.com
Tue Sep 19 12:50:21 UTC 2017


 vcl/workben/tiffuzzer.cxx |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit f02cee05a815f91d69626d18461dc384af089dfa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 19 13:10:40 2017 +0100

    ofz#3427: boost::bad_rational
    
    I'm quite content for an exception on bogus input
    
    Change-Id: Ie08396b3479114159e546395dca5370aed380378
    Reviewed-on: https://gerrit.libreoffice.org/42469
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/workben/tiffuzzer.cxx b/vcl/workben/tiffuzzer.cxx
index 200c0d339c03..b6d3df71f157 100644
--- a/vcl/workben/tiffuzzer.cxx
+++ b/vcl/workben/tiffuzzer.cxx
@@ -21,9 +21,15 @@ extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
 
 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
 {
-    SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
-    Graphic aGraphic;
-    (void)itiGraphicImport(aStream, aGraphic, nullptr);
+    try
+    {
+        SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ);
+        Graphic aGraphic;
+        (void)itiGraphicImport(aStream, aGraphic, nullptr);
+    }
+    catch (...)
+    {
+    }
     return 0;
 }
 


More information about the Libreoffice-commits mailing list