Kaydet (Commit) 437dd036 authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Cast pointer before dereferencing. (firebird-sdbc)

We have a char* pointing to arbitrary data hence we need to cast
to the right type, othwerwise we retrieve the first byte only.

Change-Id: I6d3d08d15105a506c140044008c5255a8a8e4c39
üst 3f56234e
...@@ -361,10 +361,11 @@ bool OResultSet::isNull(sal_Int32 columnIndex) ...@@ -361,10 +361,11 @@ bool OResultSet::isNull(sal_Int32 columnIndex)
template <typename T> template <typename T>
T OResultSet::retrieveValue(sal_Int32 columnIndex) T OResultSet::retrieveValue(sal_Int32 columnIndex)
{ {
// TODO: check we have the right type.
if ((m_bWasNull = isNull(columnIndex))) if ((m_bWasNull = isNull(columnIndex)))
return 0; return 0;
return *m_pSqlda->sqlvar[columnIndex-1].sqldata; return *((T*) m_pSqlda->sqlvar[columnIndex-1].sqldata);
} }
template <> template <>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment