File ghostscript-BCN-492765.patch of Package ghostscript-library
--- src/gdevpdtb.c
+++ src/gdevpdtb.c 2009-04-07 15:02:14.473713079 +0200
@@ -131,7 +131,7 @@ pdf_base_font_alloc(gx_device_pdf *pdev,
&st_pdf_base_font, "pdf_base_font_alloc");
const gs_font_name *pfname = &font->font_name;
gs_const_string font_name;
- char fnbuf[3 + sizeof(long) / 3 + 1]; /* .F#######\0 */
+ char fnbuf[2*sizeof(long) + 3]; /* .F#######\0 */
int code;
if (pbfont == 0)
--- src/scfd.c
+++ src/scfd.c 2009-04-07 14:57:53.396502091 +0200
@@ -161,7 +161,7 @@ s_CFD_release(stream_state * st)
/* makeup codes efficiently, since these are always a multiple of 64. */
#define invert_data(rlen, black_byte, makeup_action, d)\
if ( rlen > qbit )\
- { *q++ ^= (1 << qbit) - 1;\
+ { if (q >= ss->lbuf) *q++ ^= (1 << qbit) - 1; else q++;\
rlen -= qbit;\
switch ( rlen >> 3 )\
{\