X server bug 21455 patch review

Peter Hutterer peter.hutterer at who-t.net
Fri May 8 21:23:59 PDT 2009


On Fri, May 08, 2009 at 05:30:05PM -0700, Keith Packard wrote:
> Pierre Ossman proposed a fix in the non-Xkb path through
> GetKeyboardValuatorEvents for the 1.6.2 X server release. I looked at
> the patch, and at the original code, and neither seems sensible to me.
> The patch seems more symmetrical, but I can't tell if it's more right
> than the original code.
> 
> Can I get someone (whot) to take a look at the proposed patch and
> comment on whether it looks right?
> 
> http://bugs.freedesktop.org/attachment.cgi?id=25218

This patch is correct. GKVE returns the number of elements copied into
events. At the time this code is triggered, numEvents is larger than zero
and the current code advances 'events' by too much.

This has two effects:
- there will be uninitialized events between the fake releases and the
  actual key press.
- we may exceed the number of events available in the event list and write
  to uninitialised memory.

Pierre's fix ensures that we advance by the right number of events.
 
Cheers,
  Peter


More information about the xorg-devel mailing list