[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - connectivity/source

Lionel Elie Mamane lionel at mamane.lu
Tue Mar 3 01:04:57 PST 2015


 connectivity/source/commontools/FValue.cxx |   32 ++++++++++++++---------------
 1 file changed, 16 insertions(+), 16 deletions(-)

New commits:
commit e5611f0cf876817a19500861a7d508e6469ad7c0
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Mon Mar 2 18:19:18 2015 +0100

    getAny() is not a safe default, it assumes there is actually an Any
    
    at *m_aValue.m_pValue.
    But there could not even be a pointer there, e.g. if m_aValue.m_nIntXX is in use.
    Then the pointer dereference usually leads to a crash.
    Can e.g. be reproduced by calling getBytes() on an integer column of a RowSet.
    
    Change-Id: Ib5361d838d2869142fd797d4e3454e2562ea7acf
    Reviewed-on: https://gerrit.libreoffice.org/14718
    Tested-by: David Tardon <dtardon at redhat.com>
    Reviewed-by: David Tardon <dtardon at redhat.com>

diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 8e63f87..cc53d24 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -965,7 +965,7 @@ Any ORowSetValue::makeAny() const
                 break;
             default:
                 SAL_WARN( "connectivity.commontools","ORowSetValue::makeAny(): UNSPUPPORTED TYPE!");
-                rValue = getAny();
+                rValue = makeAny();
                 break;
         }
     }
@@ -1050,7 +1050,7 @@ OUString ORowSetValue::getString( ) const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= aRet;
                     break;
                 }
@@ -1121,7 +1121,7 @@ bool ORowSetValue::getBool()    const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= bRet;
                     break;
                 }
@@ -1192,7 +1192,7 @@ sal_Int8 ORowSetValue::getInt8()    const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1263,7 +1263,7 @@ sal_uInt8 ORowSetValue::getUInt8()    const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1335,7 +1335,7 @@ sal_Int16 ORowSetValue::getInt16()  const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1406,7 +1406,7 @@ sal_uInt16 ORowSetValue::getUInt16()  const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1479,7 +1479,7 @@ sal_Int32 ORowSetValue::getInt32()  const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1552,7 +1552,7 @@ sal_uInt32 ORowSetValue::getUInt32()  const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1625,7 +1625,7 @@ sal_Int64 ORowSetValue::getLong()   const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1698,7 +1698,7 @@ sal_uInt64 ORowSetValue::getULong()   const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1775,7 +1775,7 @@ float ORowSetValue::getFloat()  const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1851,7 +1851,7 @@ double ORowSetValue::getDouble()    const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= nRet;
                     break;
                 }
@@ -1922,7 +1922,7 @@ Sequence<sal_Int8>  ORowSetValue::getSequence() const
                 break;
             default:
                 {
-                    Any aValue = getAny();
+                    Any aValue = makeAny();
                     aValue >>= aSeq;
                     break;
                 }
@@ -2025,7 +2025,7 @@ Sequence<sal_Int8>  ORowSetValue::getSequence() const
                 break;
             default:
                 {
-                    Any aAnyValue = getAny();
+                    Any aAnyValue = makeAny();
                     aAnyValue >>= aValue;
                     break;
                 }
@@ -2077,7 +2077,7 @@ Sequence<sal_Int8>  ORowSetValue::getSequence() const
                 break;
             default:
                 {
-                    Any aAnyValue = getAny();
+                    Any aAnyValue = makeAny();
                     aAnyValue >>= aValue;
                     break;
                 }


More information about the Libreoffice-commits mailing list