Fix for crashing mysqltest
client/mysqltest.c: Allocate one extra byte for string terminator in varname
This commit is contained in:
parent
2fe75c389b
commit
935ad7e8f3
@ -4207,7 +4207,7 @@ static VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
|
|||||||
val_len = strlen(val) ;
|
val_len = strlen(val) ;
|
||||||
val_alloc_len = val_len + 16; /* room to grow */
|
val_alloc_len = val_len + 16; /* room to grow */
|
||||||
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
|
if (!(tmp_var=v) && !(tmp_var = (VAR*)my_malloc(sizeof(*tmp_var)
|
||||||
+ name_len, MYF(MY_WME))))
|
+ name_len+1, MYF(MY_WME))))
|
||||||
die("Out of memory");
|
die("Out of memory");
|
||||||
|
|
||||||
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;
|
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user