1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fix for BUG#15588: String overrun during sp-vars.test

The bug appears after implementation of WL#2984
(Make stored routine variables work according to the standard).
This commit is contained in:
anozdrin@mysql.com
2006-01-20 15:59:22 +03:00
parent 2c6ea2d2df
commit 145fd62bc1
5 changed files with 50 additions and 14 deletions

View File

@ -5873,7 +5873,7 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
field_length/
field_charset->mbmaxlen,
&well_formed_error);
memcpy(ptr,from,copy_length);
memmove(ptr, from, copy_length);
/* Append spaces if the string was shorter than the field. */
if (copy_length < field_length)
@ -6266,7 +6266,7 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs)
field_length/
field_charset->mbmaxlen,
&well_formed_error);
memcpy(ptr + length_bytes, from, copy_length);
memmove(ptr + length_bytes, from, copy_length);
if (length_bytes == 1)
*ptr= (uchar) copy_length;
else