Fix for crashing mysqltest

client/mysqltest.c:
  Allocate one extra byte for string terminator in varname
This commit is contained in:
unknown 2006-01-10 15:56:30 +01:00
parent 2fe75c389b
commit 935ad7e8f3

View file

@ -4207,7 +4207,7 @@ static VAR *var_init(VAR *v, const char *name, int name_len, const char *val,
val_len = strlen(val) ;
val_alloc_len = val_len + 16; /* room to grow */
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");
tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0;