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

Postfix for CORE-5277 - It's probably better to first check for well-formed data before calculat ethe length.

This commit is contained in:
Adriano dos Santos Fernandes 2016-06-17 11:08:30 +00:00
parent 9fede1eb64
commit 4ec694f7cb

View File

@ -813,6 +813,9 @@ void EXE_send(thread_db* tdbb, jrd_req* request, USHORT msg, ULONG length, const
CharSet* charSet = INTL_charset_lookup(tdbb, DSC_GET_CHARSET(desc));
if (!charSet->wellFormed(len, p))
ERR_post(Arg::Gds(isc_malformed_string));
const USHORT srcCharLen = charSet->length(len, p, false);
const USHORT dstCharLen = descLen / charSet->maxBytesPerChar();
@ -823,9 +826,6 @@ void EXE_send(thread_db* tdbb, jrd_req* request, USHORT msg, ULONG length, const
Arg::Gds(isc_string_truncation) <<
Arg::Gds(isc_trunc_limits) << Arg::Num(dstCharLen) << Arg::Num(srcCharLen));
}
if (!charSet->wellFormed(len, p))
ERR_post(Arg::Gds(isc_malformed_string));
}
else if (desc->isBlob())
{