From 61439adce623ce2e66d9f009f877e165b62f2051 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 --- 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 b16078d6c9e0..f6ce644f65ac 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -964,7 +964,7 @@ Any ORowSetValue::makeAny() const break; default: SAL_WARN( "connectivity.commontools","ORowSetValue::makeAny(): UNSPUPPORTED TYPE!"); - rValue = getAny(); + rValue = makeAny(); break; } } @@ -1049,7 +1049,7 @@ OUString ORowSetValue::getString( ) const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= aRet; break; } @@ -1120,7 +1120,7 @@ bool ORowSetValue::getBool() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= bRet; break; } @@ -1191,7 +1191,7 @@ sal_Int8 ORowSetValue::getInt8() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1262,7 +1262,7 @@ sal_uInt8 ORowSetValue::getUInt8() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1334,7 +1334,7 @@ sal_Int16 ORowSetValue::getInt16() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1405,7 +1405,7 @@ sal_uInt16 ORowSetValue::getUInt16() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1478,7 +1478,7 @@ sal_Int32 ORowSetValue::getInt32() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1551,7 +1551,7 @@ sal_uInt32 ORowSetValue::getUInt32() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1624,7 +1624,7 @@ sal_Int64 ORowSetValue::getLong() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1697,7 +1697,7 @@ sal_uInt64 ORowSetValue::getULong() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1774,7 +1774,7 @@ float ORowSetValue::getFloat() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1850,7 +1850,7 @@ double ORowSetValue::getDouble() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= nRet; break; } @@ -1921,7 +1921,7 @@ Sequence ORowSetValue::getSequence() const break; default: { - Any aValue = getAny(); + Any aValue = makeAny(); aValue >>= aSeq; break; } @@ -2024,7 +2024,7 @@ Sequence ORowSetValue::getSequence() const break; default: { - Any aAnyValue = getAny(); + Any aAnyValue = makeAny(); aAnyValue >>= aValue; break; } @@ -2076,7 +2076,7 @@ Sequence ORowSetValue::getSequence() const break; default: { - Any aAnyValue = getAny(); + Any aAnyValue = makeAny(); aAnyValue >>= aValue; break; } -- cgit