Blame SOURCES/0050-CID-736170-CID-736171-CID-736172-Out-of-Bounds-read-.patch

f0633d
From 74f181d285425bf7ec2ec8a18ad9f2e075f52594 Mon Sep 17 00:00:00 2001
f0633d
From: Julien Nabet <serval2412@yahoo.fr>
f0633d
Date: Sat, 7 Dec 2013 19:05:47 +0100
f0633d
Subject: [PATCH 050/109] CID#736170, CID#736171, CID#736172 Out-of-Bounds
f0633d
 read/write
f0633d
MIME-Version: 1.0
f0633d
Content-Type: text/plain; charset=UTF-8
f0633d
Content-Transfer-Encoding: 8bit
f0633d
f0633d
Let's be sure that nMaxcolorIndex < 256
f0633d
f0633d
Change-Id: I349184ad92c8e7b10a90a32e093972bfaee52467
f0633d
Reviewed-on: https://gerrit.libreoffice.org/6970
f0633d
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
f0633d
Tested-by: Caolán McNamara <caolanm@redhat.com>
f0633d
Reviewed-on: https://gerrit.libreoffice.org/6972
f0633d
---
f0633d
 filter/source/graphicfilter/icgm/class5.cxx | 15 +++++++--------
f0633d
 1 file changed, 7 insertions(+), 8 deletions(-)
f0633d
f0633d
diff --git a/filter/source/graphicfilter/icgm/class5.cxx b/filter/source/graphicfilter/icgm/class5.cxx
f0633d
index c0319b7..eb53788 100644
f0633d
--- a/filter/source/graphicfilter/icgm/class5.cxx
f0633d
+++ b/filter/source/graphicfilter/icgm/class5.cxx
f0633d
@@ -316,17 +316,16 @@ void CGM::ImplDoClass5()
f0633d
                     if ( nMaxColorIndex > 255 )
f0633d
                     {
f0633d
                         mbStatus = sal_False;
f0633d
+                        break;
f0633d
                     }
f0633d
-                    else
f0633d
-                    {
f0633d
-                        if ( pElement->nLatestColorMaximumIndex < nMaxColorIndex )
f0633d
-                            pElement->nLatestColorMaximumIndex = nMaxColorIndex;
f0633d
+                    if ( pElement->nLatestColorMaximumIndex < nMaxColorIndex )
f0633d
+                        pElement->nLatestColorMaximumIndex = nMaxColorIndex;
f0633d
 
f0633d
-                        for (  nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ )
f0633d
-                        {
f0633d
-                            pElement->aLatestColorTable[ nIndex ] = ImplGetBitmapColor( sal_True );
f0633d
-                        }
f0633d
+                    for (  nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ )
f0633d
+                    {
f0633d
+                        pElement->aLatestColorTable[ nIndex ] = ImplGetBitmapColor( sal_True );
f0633d
                     }
f0633d
+
f0633d
                     pElement->nColorMaximumIndex = pElement->nLatestColorMaximumIndex;
f0633d
                     for ( nIndex = nColorStartIndex; nIndex <= nMaxColorIndex; nIndex++ )
f0633d
                     {
f0633d
-- 
f0633d
1.8.4.2
f0633d