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

Make sure at least one operand is promoted to FB_UINT64 before doing the multiplication.

This commit is contained in:
robocop 2011-02-18 04:37:12 +00:00
parent 0c3d7f3c5d
commit b3d34b25c2

View File

@ -3419,8 +3419,8 @@ dsc* SysFunction::substring(thread_db* tdbb, impure_value* impure,
Firebird::HalfStaticArray<UCHAR, BUFFER_LARGE> buffer; Firebird::HalfStaticArray<UCHAR, BUFFER_LARGE> buffer;
CharSet* charSet = INTL_charset_lookup(tdbb, value->getCharSet()); CharSet* charSet = INTL_charset_lookup(tdbb, value->getCharSet());
const FB_UINT64 byte_offset = offset * charSet->maxBytesPerChar(); const FB_UINT64 byte_offset = FB_UINT64(offset) * charSet->maxBytesPerChar();
const FB_UINT64 byte_length = length * charSet->maxBytesPerChar(); const FB_UINT64 byte_length = FB_UINT64(length) * charSet->maxBytesPerChar();
if (charSet->isMultiByte()) if (charSet->isMultiByte())
{ {