diff --git a/perl-DBD-SQLite2-fetchrow.patch b/perl-DBD-SQLite2-fetchrow.patch new file mode 100644 index 0000000..9fa2b01 --- /dev/null +++ b/perl-DBD-SQLite2-fetchrow.patch @@ -0,0 +1,19 @@ +Author: Niko Tyni +Description: Fix segfault when fetchrow() is called again after it has +returned an empty list once. (#317453) +If there is a reason upstream has commented out the check +for an active handle, he's not telling it. (CPAN #16451) +--- a/dbdimp.c ++++ b/dbdimp.c +@@ -473,11 +473,9 @@ sqlite2_st_fetch (SV *sth, imp_sth_t *im + /* warn("current_entry == %d\nnumFields == %d\nnrow == %d", + current_entry, numFields, imp_sth->nrow); */ + +- /* + if (!DBIc_ACTIVE(imp_sth)) { + return Nullav; + } +- */ + + if ((imp_sth->retval == SQLITE_DONE) || (imp_sth->retval == SQLITE_ERROR)) { + sqlite2_st_finish(sth, imp_sth); diff --git a/perl-DBD-SQLite2-no-return-in-nonvoid-function.patch b/perl-DBD-SQLite2-no-return-in-nonvoid-function.patch new file mode 100644 index 0000000..d0f0895 --- /dev/null +++ b/perl-DBD-SQLite2-no-return-in-nonvoid-function.patch @@ -0,0 +1,12 @@ +Index: DBD-SQLite2-0.33/dbdimp.c +=================================================================== +--- DBD-SQLite2-0.33.orig/dbdimp.c ++++ DBD-SQLite2-0.33/dbdimp.c +@@ -459,6 +459,7 @@ sqlite2_bind_ph (SV *sth, imp_sth_t *imp + else { + av_store(imp_sth->params, SvIV(param) - 1, SvREFCNT_inc(value)); + } ++ return -1; + } + + AV * diff --git a/perl-DBD-SQLite2.changes b/perl-DBD-SQLite2.changes index 3f63128..d56f79a 100644 --- a/perl-DBD-SQLite2.changes +++ b/perl-DBD-SQLite2.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Thu Jun 7 17:51:46 UTC 2012 - lars@linux-schulserver.de + +- added perl-DBD-SQLite2-fetchrow.patch from Debian: + Fix segfault when fetchrow() is called again after it has + returned an empty list once. (#317453) +- added perl-DBD-SQLite2-no-return-in-nonvoid-function.patch: + Fix function returning random data + ------------------------------------------------------------------- Mon May 7 19:16:26 UTC 2012 - lars@linux-schulserver.de diff --git a/perl-DBD-SQLite2.spec b/perl-DBD-SQLite2.spec index 3ff5098..ac23463 100644 --- a/perl-DBD-SQLite2.spec +++ b/perl-DBD-SQLite2.spec @@ -26,9 +26,13 @@ Group: Development/Libraries/Perl Url: http://search.cpan.org/dist/DBD-SQLite2/ #Source: http://www.cpan.org/authors/id/M/MS/MSERGEANT/DBD-SQLite2-%{version}.tar.gz Source: %{cpan_name}-%{version}.tar.gz +Patch0: %{name}-fetchrow.patch +Patch1: %{name}-no-return-in-nonvoid-function.patch BuildRequires: perl BuildRequires: perl-macros +BuildRequires: sqlite2-devel BuildRequires: perl(DBI) >= 1.21 +BuildRequires: perl(Test::More) Requires: perl(DBI) >= 1.21 BuildRoot: %{_tmppath}/%{name}-%{version}-build %{perl_requires} @@ -68,6 +72,8 @@ details on how to use DBI itself. %prep %setup -q -n %{cpan_name}-%{version} +%patch0 -p1 +##%patch1 -p1 %build %{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"