1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

wb_wc and wc_mb now checks length inside

This commit is contained in:
unknown
2003-01-27 16:46:03 +04:00
parent ecb55f4307
commit e7660c64d7
11 changed files with 55 additions and 5 deletions

View File

@ -1586,6 +1586,9 @@ static int my_utf8_uni (CHARSET_INFO *cs __attribute__((unused)) ,
{
unsigned char c = s[0];
if (s >= e)
return MY_CS_TOOFEW(0);
if (c < 0x80)
{
*pwc = c;
@ -1688,6 +1691,9 @@ static int my_uni_utf8 (CHARSET_INFO *cs __attribute__((unused)) ,
{
int count;
if (r >= e)
return MY_CS_TOOSMALL;
if (wc < 0x80)
count = 1;
else if (wc < 0x800)