mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 03:23:04 +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:
parent
234e25f078
commit
5e3fd2d5a2
@ -819,6 +819,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();
|
||||
|
||||
@ -829,9 +832,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())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user