[PATCH:libXt 1/2] Incorrect cast in XtCvtIntToPixmap could cause bus error on 64-bit machines
Matt Turner
mattst88 at gmail.com
Fri Mar 4 19:25:48 PST 2011
On Sat, Mar 5, 2011 at 2:04 AM, Alan Coopersmith
<alan.coopersmith at oracle.com> wrote:
> Originally fixed by Leo Binchy for Sun Bug 4163152 to resolve bus error
> on VSW5 (XTS) testing on 64-bit SPARC test run on Solaris 7.
> ( Testcase: XtCvtIntToPixmap, Purpose: 1)
>
> Since we're converting from Int to Pixmap, need to access the argument
> passed in as an int, not a Pixmap, which is consistent with the other
> IntToXXX converters in this file.
>
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> src/Converters.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/Converters.c b/src/Converters.c
> index 95dd06b..6574ce0 100644
> --- a/src/Converters.c
> +++ b/src/Converters.c
> @@ -1360,7 +1360,7 @@ Boolean XtCvtIntToPixmap(
> XtNwrongParameters,"cvtIntToPixmap",XtCXtToolkitError,
> "Integer to Pixmap conversion needs no extra arguments",
> (String *) NULL, (Cardinal *)NULL);
> - done(Pixmap, *(Pixmap*)fromVal->addr);
> + done(Pixmap, *(int*)fromVal->addr);
> }
>
> #ifdef MOTIFBC
> --
> 1.7.3.2
Makes sense to me, and will be good for alpha too.
Reviewed-by: Matt Turner <mattst88 at gmail.com>
More information about the xorg-devel
mailing list