[gs-bugs] [Bug 690444] x11alpha can crash system on certain ps files.

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Mon Jul 5 03:03:43 UTC 2010


--- Comment #17 from Hin-Tak Leung <hintak at ghostscript.com> 2010-07-05 03:03:40 UTC ---
(In reply to comment #13)
> Created an attachment (id=5743)
 --> (http://bugs.ghostscript.com/attachment.cgi?id=5743) [details]
> bug690444.patch

Apologies for taking so long to review again, and thanks for the continual work
on this bug. A few more trivial and not-so-trivial comments:

- The XA_WIN_WORKAREA/XA_NET_WORKAREA are only used in x_get_work_area() in
base/gdevxini.c so probably should not in base/gdevx.h . In fact I can't think
of a reason for needing those defines, because using the strings directly (
x_get_win_property(..., "_WIN_WORKAREA")) probably works, and both of them are
only used exactly once.

- I would probably initialize "int workarea_width, workarea_height;" explicitly
to say, 32767/32767 ( a reasonably large/impossible screen size) as the
combination of 0/0 and x_get_work_area() failing or getting moved in a future
change, for them to be accidentally 0/0 due to other reasons is a bit

- why is "static long *x_get_win_property()" and not "static unsigned char
*x_get_win_property()"? There is no need for the explicit cast in "return (long
*)prop;" if that's the case. Looking this more carefully, it is because the
long is eventually cast'ed to an int in '*pwidth = area[2]; *pheight =

- r_type, r_format, count should be initialized to something that's not 
r_type == XA_CARDINAL , r_format == 32 , count == 4, and check for bytes_remain
 to be zero on return may be nice.

- a few brackets around "dev->width = dev->width <= area_width ?..." would be

- it appears that xsize/ysize are only calculated to be used in "xsize *
xdev->x_pixels_per_inch", which could be simplified as just "dev->width".

Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the gs-bugs mailing list