uninitialized reference in wineconsole in call to WriteConsoleInput?

Eric Pouech eric.pouech at orange.fr
Sun Nov 16 05:38:05 CST 2008


Dan Kegel a écrit :
> One more of the 100 valgrind warnings; this one is
> in kernel32/tests/console.c (but really in wineconsole).
> It's code Eric wrote six years ago, and the fix might be
> as straightforward as using memcpy(&ir, 0, sizeof(ir)) in
> WCUSER_GenerateMouseInputRecord().
> Is there a better fix?
>   
the issue in fixing WCUSER_GenerateMouseInputRecord() is that we'll 
still get the same warning in valgrind from a partly initialized 
INPUT_RECORD from any caller to WriteConsoleInput (and the code in 
wineconsole is perfectly correct as it only assigns the fields it needs 
for a MouseEvent)
the cleanest fix should be in WriteConsoleInput not to pass the 
undefined parts to wineserver (or to set them to zero)
A+
> Short form:
>
> SyscallParam wine_server_call WriteConsoleInputW
> WCUSER_GenerateMouseInputRecord WCUSER_Proc call_window_proc
> WINPROC_call_window DispatchMessageW WCUSER_MainLoop WinMain main
>
> Long form:
>
>   <kind>SyscallParam</kind>
>   <what>Syscall param writev(vector[...]) points to uninitialised byte(s)</what>
>   <stack>
>     <frame>
>       <obj>dlls/ntdll/ntdll.dll.so</obj>
>       <fn>wine_server_call</fn>
>       <dir>dlls/ntdll</dir>
>       <file>server.c</file>
>       <line>248</line>
>     </frame>
>     <frame>
>       <obj>dlls/kernel32/kernel32.dll.so</obj>
>       <fn>WriteConsoleInputW</fn>
>       <dir>dlls/kernel32/../../include/wine</dir>
>       <file>server.h</file>
>       <line>61</line>
>     </frame>
>     <frame>
>       <obj>programs/wineconsole/wineconsole.exe.so</obj>
>       <fn>WCUSER_GenerateMouseInputRecord</fn>
>       <dir>programs/wineconsole</dir>
>       <file>user.c</file>
>       <line>1087</line>
>     </frame>
>     <frame>
>       <obj>programs/wineconsole/wineconsole.exe.so</obj>
>       <fn>WCUSER_Proc</fn>
>       <dir>programs/wineconsole</dir>
>       <file>user.c</file>
>       <line>1186</line>
>     </frame>
>     <frame>
>       <obj>dlls/user32/user32.dll.so</obj>
>     </frame>
>     <frame>
>       <obj>dlls/user32/user32.dll.so</obj>
>       <fn>call_window_proc</fn>
>       <dir>dlls/user32</dir>
>       <file>winproc.c</file>
>       <line>458</line>
>     </frame>
>     <frame>
>       <obj>dlls/user32/user32.dll.so</obj>
>       <fn>WINPROC_call_window</fn>
>       <dir>dlls/user32</dir>
>       <file>winproc.c</file>
>       <line>2212</line>
>     </frame>
>     <frame>
>       <obj>dlls/user32/user32.dll.so</obj>
>       <fn>DispatchMessageW</fn>
>       <dir>dlls/user32</dir>
>       <file>message.c</file>
>       <line>3108</line>
>     </frame>
>     <frame>
>       <obj>programs/wineconsole/wineconsole.exe.so</obj>
>       <fn>WCUSER_MainLoop</fn>
>       <dir>programs/wineconsole</dir>
>       <file>user.c</file>
>       <line>1378</line>
>     </frame>
>   <origin>
>   <what>Uninitialised value was created by a stack allocation</what>
>   <stack>
>     <frame>
>       <obj>programs/wineconsole/wineconsole.exe.so</obj>
>       <fn>WCUSER_GenerateMouseInputRecord</fn>
>       <dir>programs/wineconsole</dir>
>       <file>user.c</file>
>       <line>1066</line>
>     </frame>
>   </stack>
>   </origin>
>
>
>
>
>   


-- 
Eric Pouech
"The problem with designing something completely foolproof is to underestimate the ingenuity of a complete idiot." (Douglas Adams)





More information about the wine-devel mailing list