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

Fix #6796 - Buffer overflow when padding line with national characters causes ISQL crash.

This commit is contained in:
Adriano dos Santos Fernandes 2021-05-06 14:29:03 -03:00
parent ce430f335e
commit d0e8780d14

View File

@ -8599,9 +8599,13 @@ static unsigned process_message_display(Firebird::IMessageMetadata* message, uns
pad[i] = setValues.global_Col_default;
disp_length = pad[i];
if (charSet == CS_UTF8)
if (charSet == CS_UNICODE_FSS)
disp_length *= 3;
else if (charSet == CS_UTF8)
disp_length *= 4;
}
else if (isqlGlob.att_charset == CS_UNICODE_FSS)
disp_length = MAX(disp_length, namelength * 3);
else if (isqlGlob.att_charset == CS_UTF8)
disp_length = MAX(disp_length, namelength * 4);