From b3d34b25c2a8a648aa82c6021b5a17078be98645 Mon Sep 17 00:00:00 2001 From: robocop Date: Fri, 18 Feb 2011 04:37:12 +0000 Subject: [PATCH] Make sure at least one operand is promoted to FB_UINT64 before doing the multiplication. --- src/jrd/SysFunction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jrd/SysFunction.cpp b/src/jrd/SysFunction.cpp index 1b710627b2..b4f8cdb299 100644 --- a/src/jrd/SysFunction.cpp +++ b/src/jrd/SysFunction.cpp @@ -3419,8 +3419,8 @@ dsc* SysFunction::substring(thread_db* tdbb, impure_value* impure, Firebird::HalfStaticArray buffer; CharSet* charSet = INTL_charset_lookup(tdbb, value->getCharSet()); - const FB_UINT64 byte_offset = offset * charSet->maxBytesPerChar(); - const FB_UINT64 byte_length = length * charSet->maxBytesPerChar(); + const FB_UINT64 byte_offset = FB_UINT64(offset) * charSet->maxBytesPerChar(); + const FB_UINT64 byte_length = FB_UINT64(length) * charSet->maxBytesPerChar(); if (charSet->isMultiByte()) {