[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#258365: type missmatch CascadeB.c and CascadeBG.c of Xm-2.1

Package: lesstif2
Version: 3.6.1

problem: type missmatch in size_cascade

When building this package for an AMD64 system, I notice a pointer
corruption in problem in CascadeB.c and CascadeBG.c of Xm-2.1.
One the AMD64 system, a call to size_cascade(Widget w) corrupts w on
return and triggers a fault in the calling routine.

I believe the problem is in size_cascade is the call to XGetGeometry
with the following XtDisplay(w), CB_CascadePixmap(w),
(Window *)&dummy, &dummy,&dummy,&width, &height,
(unsigned *)&dummy, (unsigned *)&dummy).  In this call, dummy is an int.
However, Window is an unsigned long.

Making a new varible dummyw of type Window fixes the problem.

diff CascadeB.c CascadeB.bak
<     Window dummyw;
<                    (Window *)&dummyw, &dummy, &dummy,
>                    (Window *)&dummy, &dummy, &dummy,

diff CascadeBG.c CascadeBG.bak
<     Window dummyw;
<                        (Window *)&dummyw, &dummy, &dummy,
>                        (Window *)&dummy, &dummy, &dummy,

There may be a better way of fixing it.
I also reported this on the AMD64 debain list.

Reply to: