[PATCH 2/2] msvcp90: Copy name in _Getctype (Valgrind)

Piotr Caban piotr.caban at gmail.com
Wed Jun 24 04:21:43 CDT 2015


On 06/23/15 22:57, Daniel Lehman wrote:
> +    name = ___lc_locale_name_func()[LC_COLLATE];
> +    size = wcslen(name)+1;
> +    ret->name = malloc(size*sizeof(*name));
> +    if (!ret->name) throw_exception(EXCEPTION_BAD_ALLOC, NULL);
> +    memcpy(ret->name, name, size);
There should be size*sizeof(*name) in memcpy. Also please rename the 
variable to len if it's used to store length (or store buffer size in it).

Thanks,
Piotr



More information about the wine-devel mailing list