Blame SOURCES/ghostscript-wrf-snprintf.patch

c9d7fc
diff -up ghostscript-9.07/base/wrfont.c.wrf-snprintf ghostscript-9.07/base/wrfont.c
c9d7fc
--- ghostscript-9.07/base/wrfont.c.wrf-snprintf	2013-07-01 13:02:33.373244683 +0100
c9d7fc
+++ ghostscript-9.07/base/wrfont.c	2013-07-01 13:04:55.022864299 +0100
c9d7fc
@@ -72,7 +72,8 @@ WRF_wfloat(WRF_output * a_output, double
c9d7fc
 {
c9d7fc
     char buffer[32];
c9d7fc
 
c9d7fc
-    gs_sprintf(buffer, "%f", a_float);
c9d7fc
+    if (gs_snprintf(buffer, sizeof (buffer), "%f", a_float) >= sizeof (buffer))
c9d7fc
+        abort();
c9d7fc
     WRF_wstring(a_output, buffer);
c9d7fc
 }
c9d7fc
 
c9d7fc
@@ -81,6 +82,7 @@ WRF_wint(WRF_output * a_output, long a_i
c9d7fc
 {
c9d7fc
     char buffer[32];
c9d7fc
 
c9d7fc
-    gs_sprintf(buffer, "%ld", a_int);
c9d7fc
+    if (gs_snprintf(buffer, sizeof (buffer), "%ld", a_int) >= sizeof (buffer))
c9d7fc
+        abort();
c9d7fc
     WRF_wstring(a_output, buffer);
c9d7fc
 }