|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57204 sqlite_escape_string tries to consume infinite memory
Submitted: 2006-08-29 17:29 UTC Modified: 2006-10-11 20:17 UTC
From: jose at psabs dot com dot br Assigned:
Status: Closed Package: SQLite (PECL)
PHP Version: 4.4.1 OS: Linux amd64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
31 + 13 = ?
Subscribe to this entry?

 [2006-08-29 17:29 UTC] jose at psabs dot com dot br
On amd64 the sqlite_escape_string function is faulty and causes PHP to
kill the script due to PHP's internal memory limit being reached.

There was a patch to solve this bug,  look at
for more information.

An example script that reproduces this problem is:

echo sqlite_escape_string("a");

Running this script will result in an error message such as:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate -1969234011 bytes) in /var/www/test.php on line 2

The string passed to sqlite_escape_string and the value of the PHP
memory limit do not effect the behaviour of the bug. The number of bytes
attempted to allocate seems completely bogus.

php5-sqlite (linked against the same libsqlite0) is not affected and
neither is php4-sqlite on i386.

This bug is currently breaking the PHPwiki package on amd64 systems.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-11 20:17 UTC] ilia at prohost dot org
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 04:03:33 2021 UTC