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

Frontport fix for CORE-2313.

This commit is contained in:
robocop 2009-02-09 12:22:04 +00:00
parent ce68fe02b8
commit 05feaac2d9
3 changed files with 9 additions and 8 deletions

View File

@ -161,7 +161,7 @@ void INF_blob_info(const blb* blob,
SLONG number = info - start_info;
memmove(start_info + 7, start_info, number);
length = INF_convert(number, buffer);
INF_put_item(isc_info_length, length, buffer, start_info, end);
INF_put_item(isc_info_length, length, buffer, start_info, end, true);
}
}
@ -801,7 +801,7 @@ SCHAR* INF_put_item(SCHAR item,
USHORT length,
const SCHAR* string,
SCHAR* ptr,
const SCHAR* end)
const SCHAR* end, const bool inserting)
{
/**************************************
*
@ -813,10 +813,11 @@ SCHAR* INF_put_item(SCHAR item,
* Put information item in output buffer if there is room, and
* return an updated pointer. If there isn't room for the item,
* indicate truncation and return NULL.
* If we are inserting, we don't need space for isc_info_end, since it was calculated already.
*
**************************************/
if (ptr + length + 4 >= end) {
if (ptr + length + (inserting ? 3 : 4) >= end) {
*ptr = isc_info_truncated;
return NULL;
}
@ -985,7 +986,7 @@ void INF_request_info(const jrd_req* request,
SLONG number = info - start_info;
memmove(start_info + 7, start_info, number);
length = INF_convert(number, buffer.begin());
INF_put_item(isc_info_length, length, buffer.begin(), start_info, end);
INF_put_item(isc_info_length, length, buffer.begin(), start_info, end, true);
}
}
@ -1102,7 +1103,7 @@ void INF_transaction_info(const jrd_tra* transaction,
SLONG number = info - start_info;
memmove(start_info + 7, start_info, number);
length = INF_convert(number, buffer);
INF_put_item(isc_info_length, length, buffer, start_info, end);
INF_put_item(isc_info_length, length, buffer, start_info, end, true);
}
}

View File

@ -33,7 +33,7 @@ namespace Jrd {
void INF_blob_info(const Jrd::blb*, const SCHAR*, const SSHORT, SCHAR*, const SSHORT);
USHORT INF_convert(SINT64, SCHAR*);
void INF_database_info(const SCHAR*, const SSHORT, SCHAR*, const SSHORT);
SCHAR* INF_put_item(SCHAR, USHORT, const SCHAR*, SCHAR*, const SCHAR*);
SCHAR* INF_put_item(SCHAR, USHORT, const SCHAR*, SCHAR*, const SCHAR*, const bool inserting = false);
void INF_request_info(const Jrd::jrd_req*, const SCHAR*, const SSHORT, SCHAR*, const SSHORT);
void INF_transaction_info(const Jrd::jrd_tra*, const SCHAR*, const SSHORT, SCHAR*, const SSHORT);

View File

@ -1424,10 +1424,10 @@ ISC_STATUS Service::query2(thread_db* tdbb,
if (start_info && (end - info >= 7))
{
const SLONG number = (info - start_info);
const SLONG number = info - start_info;
memmove(start_info + 7, start_info, number);
USHORT length2 = INF_convert(number, buffer);
INF_put_item(isc_info_length, length2, buffer, start_info, end);
INF_put_item(isc_info_length, length2, buffer, start_info, end, true);
}
if (svc_trace_manager->needs().event_service_query)