[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - filter/qa filter/source

Caolán McNamara caolanm at redhat.com
Sun Jul 19 23:16:56 PDT 2015


 filter/qa/cppunit/data/tiff/fail/crash-3.tiff |binary
 filter/source/graphicfilter/itiff/itiff.cxx   |    2 ++
 2 files changed, 2 insertions(+)

New commits:
commit e9be8b2425eb8e013e43ef7e730a05df5e4efae9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jul 19 21:32:05 2015 +0100

    check np bounds again
    
    Change-Id: I0fb61954b2eaf0c015d7bdefe9f03bd459b31501
    (cherry picked from commit fcdddbd30a8b5cf6a5cc4d2ff28b7d4a20f8ec6b)
    Reviewed-on: https://gerrit.libreoffice.org/17201
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/filter/qa/cppunit/data/tiff/fail/crash-3.tiff b/filter/qa/cppunit/data/tiff/fail/crash-3.tiff
new file mode 100644
index 0000000..4aa2393
Binary files /dev/null and b/filter/qa/cppunit/data/tiff/fail/crash-3.tiff differ
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index aed15f6..834c437 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -638,6 +638,8 @@ bool TIFFReader::ReadMap()
                     pTIFF->Seek(pStripOffsets[nStrip]);
                     aLZWDecom.StartDecompression(*pTIFF);
                 }
+                if (np >= SAL_N_ELEMENTS(pMap))
+                    return false;
                 if ( ( aLZWDecom.Decompress( pMap[ np ], nBytesPerRow ) != nBytesPerRow ) || pTIFF->GetError() )
                     return false;
             }


More information about the Libreoffice-commits mailing list