[Bug 14867] New: TrackMouseEvent thinko / valgrind warning?

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Aug 14 17:18:02 CDT 2008


http://bugs.winehq.org/show_bug.cgi?id=14867

           Summary: TrackMouseEvent thinko / valgrind warning?
           Product: Wine
           Version: CVS/GIT
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: user32
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: dank at kegel.com


An app I'm looking at is doing
  TRACKMOUSEEVENT tme;
  tme.cbSize = sizeof(TRACKMOUSEEVENT);
  tme.dwFlags = TME_LEAVE;
  tme.hwndTrack = my_hWnd;
  TrackMouseEvent(&tme);

which causes the following valgrind complaint:

Conditional jump or move depends on uninitialised value(s)
   at TrackMouseEvent (input.c:1043)
   by MyTrackMouseLeave (in app)
   ...
 Uninitialised value was created by a stack allocation
   at MyTrackMouseLeave (in app)

Looking at git blame user32/input.c, I see line 1043 is the if:
    hover_time = ptme->dwHoverTime;
    if (hover_time == HOVER_DEFAULT || hover_time == 0 ||
!(ptme->dwHoverTime&TME_HOVER))
Squinting at that a bit, it get the feeling the bitmask check is a typo;
shouldn't that be dwFlags, not dwHoverTime?
Also, if TME_HOVER is not set, we probably shouldn't
be looking at dwHoverTime, right?

FWIW, that bitmask check was added by
http://www.winehq.org/pipermail/wine-patches/2006-October/031794.html

Incidentally, while playing around, I noticed that the test
crashes if you get too many events.  I'll attach a little patch to
fail more gracefully.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list