Bug 286 - Xi: XGetDeviceDontPropagateList does not allocate enough memory on 64-Bit machines
Summary: Xi: XGetDeviceDontPropagateList does not allocate enough memory on 64-Bit mac...
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xi (show other bugs)
Version: unspecified
Hardware: Alpha All
: high critical
Assignee: Default Bug Report Assignee
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-08 02:47 UTC by Andreas Luik
Modified: 2007-01-23 20:06 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
fix for XGetDeviceDontPropagateList() on 64-Bit machines (411 bytes, patch)
2004-03-08 02:48 UTC, Andreas Luik
no flags Details | Splinter Review

Description Andreas Luik 2004-03-08 02:47:17 UTC
XEventClass is typedef'd as an "unsigned long", therefore, on an
Alpha, this is a 64-bit long cardinal, i.e. 8 bytes long.
Unfortunately, in the XGetDeviceDontPropagateList function, when the
list of XEventClass entries is allocated, the number of bytes is only
(rep.length << 2), i.e. rep.length*4.  Instead, the proper number of
bytes to allocate for the list would be "rep.length * sizeof(XEventClass).

With the current code, the memory allocated for the list will be
overwritten on a 64-bit machine like the Compaq Alpha.

The function XGetSelectedExtensionEvents (in lib/Xi/XGtSelect.c) uses
the correct computation as suggested above.
Comment 1 Andreas Luik 2004-03-08 02:48:25 UTC
Created attachment 131 [details] [review]
fix for XGetDeviceDontPropagateList() on 64-Bit machines
Comment 2 Egbert Eich 2004-03-16 04:53:42 UTC
Thanks for catching this!




Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.