Branch: Tag:

2016-01-09

2016-01-09 22:35:08 by Martin Nilsson <nilsson@fastmail.com>

Don't read out of bounds when reallocating small strings.

1597:    if( a->alloc_type == STRING_ALLOC_BA )    goto done;    s = ba_alloc(&string_allocator); -  memcpy(s,a->str,nbytes); +  memcpy(s, a->str, MINIMUM(nbytes,obytes));    free_string_content(a);    a->alloc_type = STRING_ALLOC_BA;    }