8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 15:23:02 +01:00

Fixed bug when appending vectors, thanks to Claudio

This commit is contained in:
alexpeshkoff 2008-07-28 10:07:09 +00:00
parent 71024e0a26
commit 06118555f9

View File

@ -78,13 +78,14 @@ bool StatusVector::append(const ISC_STATUS* from, int count) throw()
{
int copied = 0;
for (int i = 0; i < count; i += (from[i] == isc_arg_cstring ? 3 : 2))
for (int i = 0; i < count; )
{
copied = i;
if (m_length + copied > FB_NELEM(m_status_vector) - 1)
i += (from[i] == isc_arg_cstring ? 3 : 2);
if (m_length + i > FB_NELEM(m_status_vector) - 1)
{
break;
}
copied = i;
}
memcpy(&m_status_vector[m_length], from, copied * sizeof(m_status_vector[0]));