http://bugs.winehq.org/show_bug.cgi?id=28741
Bug #: 28741 Summary: Odd coordinate in hit test causes uninitialized value references in MONTHCAL_CalculateDayOfWeek()? Product: Wine Version: 1.3.30 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: comctl32 AssignedTo: wine-bugs@winehq.org ReportedBy: dank@kegel.com Classification: Unclassified
Running "make monthcal.ok" in comctl32/tests with Valgrind reports:
Conditional jump or move depends on uninitialised value(s) at __moddi3 (in dlls/ntdll/ntdll.dll.so) by RtlTimeToTimeFields (time.c:126) by FileTimeToSystemTime (time.c:858) by MONTHCAL_CalculateDayOfWeek (monthcal.c:469) by MONTHCAL_GetMonth (monthcal.c:486) by MONTHCAL_HitTest (monthcal.c:498) by MONTHCAL_WindowProc (monthcal.c:2861) by ??? (in /oldhome/dank/wine-git/dlls/user32/user32.dll.so) by call_window_proc (winproc.c:242) by WINPROC_CallProcAtoW (winproc.c:601) by CallWindowProcA (winproc.c:960) by monthcal_subclass_proc (monthcal.c:566) by ??? (in dlls/user32/user32.dll.so) by call_window_proc (winproc.c:242) by WINPROC_call_window (winproc.c:908) by call_window_proc (message.c:2211) by send_message (message.c:3084) by SendMessageA (message.c:3286) by test_hittest (monthcal.c:1042) by func_monthcal (monthcal.c:1957) by run_test (test.h:556) by main (test.h:624) Uninitialised value was created by a stack allocation at MONTHCAL_CalculateDayOfWeek (monthcal.c:462)
Something seems to be creating an out of range date; then when MONTHCAL_CalculateDayOfWeek() converts to (and then back from) a different time representation, the conversion fails, leading to use of garbage.
My guess is that test_hittest() is picking some area to hittest that is driving the code bonkers. We get lucky, and the test passes anyway. I don't know if a real hittest could give the wrong answer in some situations.