[perl-Text-CSV_XS/f16] Fix sc_cache initialization
Petr Pisar
ppisar at fedoraproject.org
Tue Dec 4 10:45:59 UTC 2012
commit ca0bf529c67563ffb07316aeaba0467f3efb30df
Author: Petr Písař <ppisar at redhat.com>
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 at redhat.com>
+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 49940bf..2d83429 100644
--- a/perl-Text-CSV_XS.spec
+++ b/perl-Text-CSV_XS.spec
@@ -1,11 +1,13 @@
Name: perl-Text-CSV_XS
Version: 0.82
-Release: 2%{?dist}
+Release: 3%{?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)
@@ -26,6 +28,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):
@@ -62,6 +65,9 @@ make test
%changelog
+* Tue Dec 04 2012 Petr Pisar <ppisar at redhat.com> - 0.82-3
+- Fix sc_cache initialization (CPAN RT #81469)
+
* Mon Jun 20 2011 Marcela Mašláňová <mmaslano at redhat.com> - 0.82-2
- Perl mass rebuild
More information about the scm-commits
mailing list