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

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Wed Jul 7 12:10:08 UTC 2010


http://bugs.ghostscript.com/show_bug.cgi?id=690444

Boris Ananine <foxb2673 at mail.redcom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #5743|0                           |1
        is obsolete|                            |

--- Comment #19 from Boris Ananine <foxb2673 at mail.redcom.ru> 2010-07-07 12:09:57 UTC ---
Created an attachment (id=6440)
 --> (http://bugs.ghostscript.com/attachment.cgi?id=6440)
Proposed patch

> - 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.

Fixed.

> - 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
> unpleasant.

Current implementation of x_get_work_area can't fail leaving its output vars
uninitialized: they'll be assigned WidthOfScreen and HeightOfScreen of
xdev->scr respectively.
Future changes may of course rearrange the things, so if you insists on inline
initialization in calling functions, here you are. :)

> - 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.

Fixed.

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

Entire expression has been simplified.

> - 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".

Fixed (in gdev_x_put_params).

-- 
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