[packages/perl-PDL] - fix format string errors

baggins baggins at pld-linux.org
Tue Jun 11 12:24:11 CEST 2013


commit f7559f58f32b8a8196075043335222ef802f9195
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Jun 11 12:24:00 2013 +0200

    - fix format string errors

 format-security.patch | 207 ++++++++++++++++++++++++++++++++++++++++++++++++++
 perl-PDL.spec         |   2 +
 2 files changed, 209 insertions(+)
---
diff --git a/perl-PDL.spec b/perl-PDL.spec
index f38a50d..0ec9068 100644
--- a/perl-PDL.spec
+++ b/perl-PDL.spec
@@ -25,6 +25,7 @@ Patch2:		%{name}-Makefile.PL.patch-dumb
 Patch3:		%{name}-fftw-shared.patch
 Patch4:		%{name}-vendorarch.patch
 Patch5:		PDL-Disable-PDL-GIS-Proj.patch
+Patch6:		format-security.patch
 URL:		http://pdl.perl.org/
 BuildRequires:	fftw-devel >= 2.1.3-5
 BuildRequires:	gd-devel
@@ -465,6 +466,7 @@ Przykładowe skrypty z użyciem PDL.
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 %{__perl} -pi -e 's/\b(pdlpp_postamble)\b/$1_int/g' Graphics/PLplot/Makefile.PL
 # g77 flags for compiling Slatec:
diff --git a/format-security.patch b/format-security.patch
new file mode 100644
index 0000000..2bb5cfe
--- /dev/null
+++ b/format-security.patch
@@ -0,0 +1,207 @@
+diff -ur PDL-2.4.11/Graphics/PLplot/plplot.pd PDL-2.4.11-format/Graphics/PLplot/plplot.pd
+--- PDL-2.4.11/Graphics/PLplot/plplot.pd	2012-01-03 00:56:28.000000000 +0100
++++ PDL-2.4.11-format/Graphics/PLplot/plplot.pd	2013-06-11 12:22:34.297791003 +0200
+@@ -3544,7 +3544,7 @@
+ #define check_sub_pointer(subptr, errmsg) \
+   if (SvTRUE (subptr) \
+       && (! SvROK (subptr) || SvTYPE (SvRV (subptr)) != SVt_PVCV)) \
+-    croak (errmsg);
++    croak ("%s", errmsg);
+ 
+ static SV* pltr_subroutine;
+ 
+diff -ur PDL-2.4.11/IO/GD/GD.pd PDL-2.4.11-format/IO/GD/GD.pd
+--- PDL-2.4.11/IO/GD/GD.pd	2012-02-10 04:05:44.000000000 +0100
++++ PDL-2.4.11-format/IO/GD/GD.pd	2013-06-11 12:22:12.644236663 +0200
+@@ -107,7 +107,7 @@
+ {
+     sprintf(str, "Wrong LUT dimensions (%d, %d)! (should be (3, X), where X <= 256)\n",
+             $SIZE(i), $SIZE(j) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ xsize = $SIZE(x);
+@@ -122,7 +122,7 @@
+     if (tmp != ind)
+     {
+         sprintf(str, "palette mismatch on index %d (mapped to %d)!\n", ind, tmp);
+-        croak(str);
++        croak("%s",str);
+     }
+ }
+ 
+@@ -165,14 +165,14 @@
+ {
+     sprintf(str, "Invalid compression level %d, should be [-1,9]!\n", 
+         $COMP(level) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ if ($SIZE(i) != 3 || $SIZE(j) > 256)
+ {
+     sprintf(str, "Wrong LUT dimensions (%d, %d)! (should be (3, X), where X <= 256)\n",
+             $SIZE(i), $SIZE(j) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ xsize = $SIZE(x);
+@@ -187,7 +187,7 @@
+     if (tmp != ind)
+     {
+         sprintf(str, "palette mismatch on index %d (mapped to %d)!\n", ind, tmp);
+-        croak(str);
++        croak("%s",str);
+     }
+ }
+ 
+@@ -231,7 +231,7 @@
+ {
+     sprintf(str, "Wrong dimensions (%d, %d, %d)! (should be (X,Y,3))\n",
+             $SIZE(x), $SIZE(y), $SIZE(z) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ xsize = $SIZE(x);
+@@ -278,14 +278,14 @@
+ {
+     sprintf(str, "Invalid compression level %d, should be [-1,9]!\n", 
+         $COMP(level) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ if ($SIZE(z) != 3)
+ {
+     sprintf(str, "Wrong dimensions (%d, %d, %d)! (should be (X,Y,3))\n",
+             $SIZE(x), $SIZE(y), $SIZE(z) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ xsize = $SIZE(x);
+@@ -490,14 +490,14 @@
+ if ( in == NULL )
+ {
+     sprintf(str, "%sError opening %s!\n", func, $COMP(filename));
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ im = gdImageCreateFromPng(in);
+ if ( im == NULL )
+ {
+     sprintf(str, "%sError reading PNG data!\n", func);
+-    croak(str);
++    croak("%s",str);
+ }
+ fclose(in);
+ 
+@@ -509,7 +509,7 @@
+ {
+     sprintf(str, "%sDims of %s (%dx%d) and piddle (%dx%d) do not match!\n",
+             func, $COMP(filename), xsize, ysize, $SIZE(x), $SIZE(y));
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ /* read the data */
+@@ -542,14 +542,14 @@
+ if ( in == NULL )
+ {
+     sprintf(str, "%sError opening %s!\n", func, $COMP(filename));
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ im = gdImageCreateFromPng(in);
+ if ( im == NULL )
+ {
+     sprintf(str, "%sError reading PNG data!\n", func);
+-    croak(str);
++    croak("%s",str);
+ }
+ fclose(in);
+ 
+@@ -561,7 +561,7 @@
+ {
+     sprintf(str, "%sDims of %s (%dx%d) and piddle (%dx%d) do not match!\n",
+             func, $COMP(filename), xsize, ysize, $SIZE(x), $SIZE(y));
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ /* read the data */
+@@ -594,7 +594,7 @@
+ {
+     sprintf(str, "%sDims of gdImage (%dx%d) and piddle (%dx%d) do not match!\n",
+             func, xsize, ysize, $SIZE(x), $SIZE(y));
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ /* read the data */
+@@ -628,7 +628,7 @@
+ {
+     sprintf(str, "%sDims of gdImage (%dx%d) and piddle (%dx%d) do not match!\n",
+             func, xsize, ysize, $SIZE(x), $SIZE(y));
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ /* read the data */
+@@ -653,7 +653,7 @@
+ {
+     sprintf(str, "Wrong dimensions (%d, %d, %d)! (should be (X,Y,3))\n",
+             $SIZE(x), $SIZE(y), $SIZE(z) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ xsize = $SIZE(x);
+@@ -690,7 +690,7 @@
+ {
+     sprintf(str, "Wrong LUT dimensions (%d, %d)! (should be (3, X), where X <= 256)\n",
+             $SIZE(i), $SIZE(j) );
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ xsize = $SIZE(x);
+@@ -705,7 +705,7 @@
+     if (tmp != ind)
+     {
+         sprintf(str, "palette mismatch on index %d (mapped to %d)!\n", ind, tmp);
+-        croak(str);
++        croak("%s",str);
+     }
+ }
+ 
+@@ -756,21 +756,21 @@
+ if ( $SIZE(c) != 3 )
+ {
+     sprintf(str, "%sLUT dims should be 3,256!\n", func);
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ in = fopen($COMP(filename), "rb");
+ if ( in == NULL )
+ {
+     sprintf(str, "%sError opening %s!\n", func, $COMP(filename));
+-    croak(str);
++    croak("%s",str);
+ }
+ 
+ im = gdImageCreateFromPng(in);
+ if ( im == NULL )
+ {
+     sprintf(str, "%sError reading PNG data!\n", func);
+-    croak(str);
++    croak("%s",str);
+ }
+ fclose(in);
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/perl-PDL.git/commitdiff/f7559f58f32b8a8196075043335222ef802f9195



More information about the pld-cvs-commit mailing list