Skip to content

Commit 6d594b5

Browse files
committed
Fix #7243 - Some UNICODE characters can lead to wrong CONTAINING evaluation when lower/upper uses different number of bytes in its encoding.
1 parent 3ade7d9 commit 6d594b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/jrd/intl_classes.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ class UpcaseConverter : public PrevConverter
8787
UpcaseConverter(MemoryPool& pool, TextType* obj, const UCHAR*& str, SLONG& len)
8888
: PrevConverter(pool, obj, str, len)
8989
{
90-
obj->str_to_upper(len, str, len, tempBuffer.getBuffer(len, false));
90+
const auto charSet = obj->getCharSet();
91+
const auto bufferSize = len / charSet->minBytesPerChar() * charSet->maxBytesPerChar();
92+
93+
len = obj->str_to_upper(len, str, bufferSize, tempBuffer.getBuffer(bufferSize, false));
9194
str = tempBuffer.begin();
9295
}
9396

0 commit comments

Comments
 (0)