Bug 20293 - wrong size of alloc memory in XGetDeviceControl
Summary: wrong size of alloc memory in XGetDeviceControl
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/Xi (show other bugs)
Version: git
Hardware: All Linux (All)
: high blocker
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-24 07:11 UTC by Hyunwoo Park
Modified: 2009-02-24 23:04 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Hyunwoo Park 2009-02-24 07:11:24 UTC
Hi. :)

I made a program that calls XGetDeviceControl. first, it seems work fine. but after a while, it always crash when I alloc another memory.
after some digging out, I found that XGetDeviceControl screws up the memory allocation table on libc.
XGetDeviceControl in git(https://bugs.freedesktop.org/enter_bug.cgi?product=xorg) at line #122, it allocates memory for xDeviceAbsCalibState(small "x"). but XDeviceAbsCalibState(large "X") is filled on that memory. acturally, the size of the structures are different.
I'm working with DEVICE_ABS_CALIB parameter. but, DEVICE_ABS_AREA, DEVICE_CORE, DEVICE_ENABLE controls seems to be at the same situation.

Regards
Comment 1 Peter Hutterer 2009-02-24 23:04:24 UTC
Fixed with cbdc33d903ec6f90a42ec3c31905eeaef9ecf0a2, thanks for reporting.


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.