php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #77977
Patch prevent-uaf revision 2019-05-08 09:25 UTC by cmb@php.net

Patch prevent-uaf for SQLite related Bug #77977

Patch version 2019-05-08 09:25 UTC

Return to Bug #77977 | Download this patch
Patch Revisions:

Developer: cmb@php.net

 ext/sqlite3/sqlite3.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c
index 43ae17297e..4afc8643c6 100644
--- a/ext/sqlite3/sqlite3.c
+++ b/ext/sqlite3/sqlite3.c
@@ -198,6 +198,9 @@ PHP_METHOD(sqlite3, close)
             errcode = sqlite3_close(db_obj->db);
             if (errcode != SQLITE_OK) {
 			    php_sqlite3_error(db_obj, "Unable to close database: %d, %s", errcode, sqlite3_errmsg(db_obj->db));
+				if (errcode == SQLITE_BUSY) {
+					db_obj->initialised = 0;
+				}
                 RETURN_FALSE;
 		    }
         }
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 18:01:29 2024 UTC