From 57b8712a835be32518dae4152cb331f3ec3b4127 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 9 Jul 2013 11:47:46 +0100 Subject: [PATCH] Test build for debugging bug #979681. WRF_wfloat() now aborts if the buffer would have been truncated. --- ghostscript-wrf-snprintf.patch | 4 ++-- ghostscript.spec | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ghostscript-wrf-snprintf.patch b/ghostscript-wrf-snprintf.patch index b0da853..74d8c2a 100644 --- a/ghostscript-wrf-snprintf.patch +++ b/ghostscript-wrf-snprintf.patch @@ -7,7 +7,7 @@ diff -up ghostscript-9.07/base/wrfont.c.wrf-snprintf ghostscript-9.07/base/wrfon - gs_sprintf(buffer, "%f", a_float); + if (gs_snprintf(buffer, sizeof (buffer), "%f", a_float) >= sizeof (buffer)) -+ buffer[sizeof (buffer) - 1] = '\0'; ++ abort(); WRF_wstring(a_output, buffer); } @@ -17,6 +17,6 @@ diff -up ghostscript-9.07/base/wrfont.c.wrf-snprintf ghostscript-9.07/base/wrfon - gs_sprintf(buffer, "%ld", a_int); + if (gs_snprintf(buffer, sizeof (buffer), "%ld", a_int) >= sizeof (buffer)) -+ buffer[sizeof (buffer) - 1] = '\0'; ++ abort(); WRF_wstring(a_output, buffer); } diff --git a/ghostscript.spec b/ghostscript.spec index 86622e5..2b8a0c5 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 8%{?dist} +Release: 8.1%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -353,6 +353,10 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Tue Jul 9 2013 Tim Waugh 9.07-8.1 +- Test build for debugging bug #979681. WRF_wfloat() now aborts if + the buffer would have been truncated. + * Mon Jul 1 2013 Tim Waugh 9.07-8 - Use correct colord device ID in gstoraster.