[perl-Text-CSV_XS/f17] Fix sc_cache initialization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 10598a853bbd26821cd5b5fd527f1b24706a6b6a
Author: Petr Písař <ppisar@xxxxxxxxxx>
Date:   Tue Dec 4 11:30:38 2012 +0100

    Fix sc_cache initialization

 ...e-init-global-buffer-overflow-Reini-Urban.patch |   37 ++++++++++++++++++++
 perl-Text-CSV_XS.spec                              |    8 ++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/Text-CSV_XS-88-Fix-sv_cache-init-global-buffer-overflow-Reini-Urban.patch b/Text-CSV_XS-88-Fix-sv_cache-init-global-buffer-overflow-Reini-Urban.patch
new file mode 100644
index 0000000..44ee45a
--- /dev/null
+++ b/Text-CSV_XS-88-Fix-sv_cache-init-global-buffer-overflow-Reini-Urban.patch
@@ -0,0 +1,37 @@
+From eabad0bdfbb6e62261279e4a53682b2d28ffd678 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@xxxxxxxxxx>
+Date: Tue, 4 Dec 2012 11:09:45 +0100
+Subject: [PATCH] Fix sv_cache init global-buffer-overflow (Reini Urban -
+ RT#81469)
+
+Ported to 0.88.
+---
+ CSV_XS.xs | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CSV_XS.xs b/CSV_XS.xs
+index 2d119af..89ec61a 100644
+--- a/CSV_XS.xs
++++ b/CSV_XS.xs
+@@ -201,6 +201,7 @@ xs_error_t xs_errors[] =  {
+     {    0, "" },
+     };
+ 
++static char init_cache[CACHE_SIZE];
+ static int  io_handle_loaded = 0;
+ static SV  *m_getline, *m_print;
+ 
+@@ -529,9 +530,8 @@ static void cx_SetupCsv (pTHX_ csv_t *csv, HV *self, SV *pself)
+ 	csv->verbatim			= bool_opt ("verbatim");
+ 	csv->auto_diag			= bool_opt ("auto_diag");
+ 
+-	sv_cache = newSVpvn ("", CACHE_SIZE);
++	sv_cache = newSVpvn (init_cache, CACHE_SIZE);
+ 	csv->cache = (byte *)SvPVX (sv_cache);
+-	memset (csv->cache, 0, CACHE_SIZE);
+ 	SvREADONLY_on (sv_cache);
+ 
+ 	csv->cache[CACHE_ID_quote_char]			= csv->quote_char;
+-- 
+1.7.11.7
+
diff --git a/perl-Text-CSV_XS.spec b/perl-Text-CSV_XS.spec
index 6f43e75..1d4d8fc 100644
--- a/perl-Text-CSV_XS.spec
+++ b/perl-Text-CSV_XS.spec
@@ -1,11 +1,13 @@
 Name:           perl-Text-CSV_XS
 Version:        0.88
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Comma-separated values manipulation routines
 Group:          Development/Libraries
 License:        GPL+ or Artistic
 URL:            http://search.cpan.org/dist/Text-CSV_XS/
 Source0:        http://www.cpan.org/authors/id/H/HM/HMBRAND/Text-CSV_XS-%{version}.tgz
+# In upstream 0.94, CPAN RT #81469
+Patch0:         Text-CSV_XS-88-Fix-sv_cache-init-global-buffer-overflow-Reini-Urban.patch
 BuildRequires:  perl(Test::Pod)
 BuildRequires:  perl(Test::Pod::Coverage)
 BuildRequires:  perl(ExtUtils::MakeMaker)
@@ -25,6 +27,7 @@ fields into a CSV string and parse a CSV string into fields.
 
 %prep
 %setup -q -n Text-CSV_XS-%{version}
+%patch0 -p1
 iconv -f latin1 -t utf8 ChangeLog > ChangeLog.utf8 && mv ChangeLog.utf8 ChangeLog
 chmod -c a-x examples/*
 # Upstream does this on purpose (2011-03-23):
@@ -61,6 +64,9 @@ make test
 
 
 %changelog
+* Tue Dec 04 2012 Petr Pisar <ppisar@xxxxxxxxxx> - 0.88-2
+- Fix sc_cache initialization (CPAN RT #81469)
+
 * Mon Mar 19 2012 Petr Pisar <ppisar@xxxxxxxxxx> - 0.88-1
 - 0.88 bump
 - Fix parsing fields that contain excessive $/
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel



[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux