From 6b701c7242f74a6395348f9c9bf2dbb99eb4ee92 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Mon, 2 Mar 2015 18:19:18 +0100 Subject: 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/14720 Tested-by: David Tardon Reviewed-by: David Tardon (cherry picked from commit 998f8cf5419f3da086246094408a50ab1e9d61f3) --- connectivity/source/commontools/FValue.cxx | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index e7bb80306cd3..e4249624e088 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 ORowSetValue::getSequence() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= aSeq; break; } @@ -2025,7 +2025,7 @@ Sequence ORowSetValue::getSequence() const break; default: { - Any aAnyValue = getAny(); + Any aAnyValue = makeAny(); aAnyValue >>= aValue; break; } @@ -2077,7 +2077,7 @@ Sequence ORowSetValue::getSequence() const break; default: { - Any aAnyValue = getAny(); + Any aAnyValue = makeAny(); aAnyValue >>= aValue; break; } -- cgit v1.2.3