mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
wb_wc and wc_mb now checks length inside
This commit is contained in:
parent
ecb55f4307
commit
e7660c64d7
11 changed files with 55 additions and 5 deletions
|
|
@ -96,6 +96,9 @@ static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)),
|
|||
const unsigned char *str,
|
||||
const unsigned char *end __attribute__((unused)))
|
||||
{
|
||||
if (str >= end)
|
||||
return MY_CS_TOOFEW(0);
|
||||
|
||||
*wc=str[0];
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -105,6 +108,9 @@ static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
|
|||
unsigned char *s,
|
||||
unsigned char *e __attribute__((unused)))
|
||||
{
|
||||
if (s >= e)
|
||||
return MY_CS_TOOSMALL;
|
||||
|
||||
if (wc < 256)
|
||||
{
|
||||
s[0]= (char) wc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue