[PATCH] riched20: Properly initialize variable (valgrind)

Nikolay Sivov nsivov at codeweavers.com
Wed Feb 19 08:33:33 CST 2020



On 2/19/20 5:26 PM, Fabian Maurer wrote:
> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48628
> Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
> ---
>   dlls/riched20/editor.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
> index c4a6902733..29e17180d4 100644
> --- a/dlls/riched20/editor.c
> +++ b/dlls/riched20/editor.c
> @@ -416,10 +416,8 @@ static void ME_ApplyBorderProperties(RTF_Info *info,
>
>   void ME_RTFCharAttrHook(RTF_Info *info)
>   {
> -  CHARFORMAT2W fmt;
> +  CHARFORMAT2W fmt = {0};
>     fmt.cbSize = sizeof(fmt);
> -  fmt.dwMask = 0;
> -  fmt.dwEffects = 0;
>
>     switch(info->rtfMinor)
>     {
> --
> 2.25.1
>
>
While this will silence the warning, which case is the problem? It could 
indicate actual issue somewhere else in the code, when mask is set for 
uninitialized field, or field is used with mask unset.



More information about the wine-devel mailing list