[Libreoffice-commits] core.git: 2 commits - sw/source

Jan Holesovsky kendy at collabora.com
Mon Feb 17 21:08:47 CET 2014


 sw/source/filter/html/parcss1.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3ecdc23d164d8e8632375247604cddf04f1e4df4
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Feb 17 21:00:03 2014 +0100

    Let's not parse nonsensical data.
    
    Change-Id: Icf956c3824286e8244cf5809be88568de0d6a068

diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx
index 8489355..692474b 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1273,11 +1273,11 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
         {
             sal_uInt8 aColors[3] = { 0, 0, 0 };
 
-            OSL_ENSURE( aValue.startsWithIgnoreAsciiCase( "rgb" ) &&
-                        aValue.getLength() > 5 &&
-                        '(' == aValue[3] &&
-                        ')' == aValue[aValue.getLength()-1],
-                        "keine gueltiges RGB(...)" );
+            if (!aValue.startsWithIgnoreAsciiCase( "rgb" ) || aValue.getLength() < 6 ||
+                    aValue[3] != '(' || aValue[aValue.getLength()-1] != ')')
+            {
+                break;
+            }
 
             OUString aColorStr(aValue.copy(4, aValue.getLength() - 5));
 
commit 2afb605601ec0b29e177dd38e4f16bfe06590882
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Mon Feb 17 20:49:24 2014 +0100

    Fix crash in css rgb color handling.
    
    Crashing since 2000 (or earlier).
    
    Change-Id: I9f91d56f380be2421370b0acbee351461e1f0973

diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx
index 3dfbaea..8489355 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -1279,7 +1279,7 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
                         ')' == aValue[aValue.getLength()-1],
                         "keine gueltiges RGB(...)" );
 
-            OUString aColorStr( aValue.copy( 4, aValue.getLength()-1 ) );
+            OUString aColorStr(aValue.copy(4, aValue.getLength() - 5));
 
             sal_Int32 nPos = 0;
             sal_uInt16 nCol = 0;


More information about the Libreoffice-commits mailing list