FontDlg fix

Alexandre Julliard julliard at winehq.org
Thu Aug 19 15:17:15 CDT 2004


Jacek Caban<jack at itma.pwr.wroc.pl> writes:

> +  if(chf16->lpTemplateName)
> +  {
> +      len1 = strlen(MapSL(chf16->lpTemplateName));
> +      chf32w->lpTemplateName = malloc(len1 * sizeof(WCHAR));
> +      MultiByteToWideChar(CP_ACP, 0, (LPSTR)MapSL(chf16->lpTemplateName),
> +                      len1, (LPWSTR)chf32w->lpTemplateName, len1);
> +  }
> +  if(chf16->lpszStyle)
> +  {
> +      len2 = strlen(MapSL(chf16->lpszStyle));
> +      chf32w->lpszStyle = malloc(len2 * sizeof(WCHAR));
> +      MultiByteToWideChar(CP_ACP, 0, (LPSTR)MapSL(chf16->lpTemplateName),
> +                      len2, chf32w->lpszStyle, len2);
> +  }

These strings never get freed (and please use HeapAlloc instead of
malloc). Also the length arguments are wrong, you can't use strlen()
to determine the size of the Unicode string. There are similar
problems at other places in your patch too.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list