Control: tag -1 patch
On Sat, Jan 19, 2019 at 03:44:43PM +0200, Adrian Bunk wrote:
> Source: libdbd-sqlite3-perl
> Version: 1.62-1
> Severity: serious
> Tags: ftbfs
>
> https://buildd.debian.org/status/fetch.php?pkg=libdbd-sqlite3-perl&arch=mips&ver=1.62-1&stamp=1546291045&raw=0
> Test Summary Report
> -------------------
> t/65_db_config.t (Wstat: 11 Tests: 76
> Failed: 0)
> Non-zero wait status: 11
> Parse errors: Bad plan. You planned 79 tests but ran 76.
Hi, a standalone test case is
perl -Iblib/lib -Iblib/arch -MDBI -e
'DBI->connect("dbi:SQLite:dbname=:memory:", "","", { sqlite_defensive => 1})'
and the attached patch fixes it for me.
--
Niko Tyni [email protected]
>From daf3153f7ad67edd7071886c866fe790a7875427 Mon Sep 17 00:00:00 2001
From: Niko Tyni <[email protected]>
Date: Wed, 13 Feb 2019 20:42:06 +0000
Subject: [PATCH] Fix SQLITE_DBCONFIG_DEFENSIVE parameter types
The sqlite3_db_config() function with SQLITE_DBCONFIG_DEFENSIVE
takes two 'int' parameters, but Perl integers may have a different
size. Passing a 64-bit argument ('long long int') has been observed
to cause a segmentation fault on 32-bit big-endian platforms.
Bug: https://github.com/DBD-SQLite/DBD-SQLite/issues/45
Bug-Debian: https://bugs.debian.org/919773
---
dbdimp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dbdimp.c b/dbdimp.c
index ee08425..f4523d7 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -463,7 +463,7 @@ sqlite_db_login6(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *user, char *pa
if (hv_exists(hv, "sqlite_defensive", 16)) {
val = hv_fetch(hv, "sqlite_defensive", 16, 0);
if (val && SvIOK(*val)) {
- sqlite3_db_config(imp_dbh->db, SQLITE_DBCONFIG_DEFENSIVE, SvIV(*val), 0);
+ sqlite3_db_config(imp_dbh->db, SQLITE_DBCONFIG_DEFENSIVE, (int)SvIV(*val), 0);
}
}
}
--
2.11.0