Subject: | sqlite_see_if_its_a_number causes a buffer overflow |
Date: | Fri, 6 Jan 2012 09:35:26 +0000 |
To: | bug-DBD-SQLite [...] rt.cpan.org |
From: | Gil Gamesh <gamesh.g [...] gmail.com> |
The following code produces a crash. An SQLite database table is
being searched for a particular string. The code for the table is given
after __DATA__ - but the table can be empty and the crash still happens.
If the line 'sqlite_see_if_its_a_number => 1' is commented out there is
no crash.
I've attached the backtrace and memory map in a text file.
I'm running Kubuntu 11.10 on an i386 machine.
J.
use 5.012;
use DBI;
my $dbh = DBI->connect(
qq{dbi:SQLite:dbname=mincase.db},
q{}, q{},
{
sqlite_see_if_its_a_number => 1,
}
) or croak $DBI::errstr;
my $db_row = $dbh->selectrow_hashref(
qq{SELECT id FROM ip_address WHERE name = ?},
{},
'552000.60e40deb.9b25d191.ip'
);
exit;
__DATA__
CREATE TABLE ip_address (
id INTEGER PRIMARY KEY,
name text NOT NULL UNIQUE
);
Message body is not shown because sender requested not to inline it.