Bug 267

Summary: X server crashes when X-Resource has to byte-swap
Product: xorg Reporter: Alan Coopersmith <alan.coopersmith>
Component: Server/GeneralAssignee: Alan Coopersmith <alan.coopersmith>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch to xc/programs/Xserver/Xext/xres.c none

Description Alan Coopersmith 2004-03-03 18:06:21 UTC
Running xrestop from a remote host of a different endianness (i.e. sparc <-> x86)
causes the X server to crash in the X-Resource extension code.

Investigatin showed this was because ProcXResQueryClients &
ProcXResQueryClientResources access variables after byte swapping them, 
thus getting very wrong results when using those as offsets into arrays 
and in other calculations.  Changing them to keep a non-byte-swapped copy on
the stack and to use that fixed the crash and allowed xrestop to run.
Comment 1 Alan Coopersmith 2004-03-03 18:08:56 UTC
Created attachment 119 [details] [review]
Patch to xc/programs/Xserver/Xext/xres.c
Comment 2 Alan Coopersmith 2004-03-03 18:13:43 UTC
Fix committed to XORG-CURRENT branch:
  21.  X server crashes when X-Resource has to byte-swap.  Sun bug #5007488.
       freedesktop.org bugzilla #267.  (Alan Coopersmith)
Comment 3 Alan Coopersmith 2004-03-03 18:25:04 UTC
Also reported to XFree86 at http://bugs.xfree86.org/show_bug.cgi?id=1242   

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.