mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Bug #48888 mysqltest crashes on --replace_result if 'from' is longer than ~1024 symbols
valgrind pointed to a buffer allocated by my_realloc which looked fishy Replaced size with what was probably intended, added test case. Now also fixed line after review comment
This commit is contained in:
@@ -9452,7 +9452,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
|
||||
if (pa->length+length >= pa->max_length)
|
||||
{
|
||||
if (!(new_pos= (uchar*) my_realloc((uchar*) pa->str,
|
||||
(uint) (pa->max_length+PS_MALLOC),
|
||||
(uint) (pa->length+length+PS_MALLOC),
|
||||
MYF(MY_WME))))
|
||||
DBUG_RETURN(1);
|
||||
if (new_pos != pa->str)
|
||||
@@ -9463,7 +9463,7 @@ int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
|
||||
char*);
|
||||
pa->str=new_pos;
|
||||
}
|
||||
pa->max_length+=PS_MALLOC;
|
||||
pa->max_length= pa->length+length+PS_MALLOC;
|
||||
}
|
||||
if (pa->typelib.count >= pa->max_count-1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user