diff options
author | Scott MacVicar <scottmac@php.net> | 2011-01-03 19:15:36 +0000 |
---|---|---|
committer | Scott MacVicar <scottmac@php.net> | 2011-01-03 19:15:36 +0000 |
commit | aff978c223d46aba336bbbf8368822095a2b143c (patch) | |
tree | 75089c85ed618465da35aade778083d63f6e2d36 /ext/sqlite3/sqlite3.c | |
parent | 95dbc9d3f07545813bb403d9f532dff6fb80833a (diff) | |
download | php-git-aff978c223d46aba336bbbf8368822095a2b143c.tar.gz |
Fix error with initialisation flag being set too early. If encryption is enabled and fails to decrypt a crash can occur.
Also fix a WS error.
Diffstat (limited to 'ext/sqlite3/sqlite3.c')
-rw-r--r-- | ext/sqlite3/sqlite3.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index bd2ad9e549..d3d92aaa8b 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -40,7 +40,7 @@ ZEND_DECLARE_MODULE_GLOBALS(sqlite3) static PHP_GINIT_FUNCTION(sqlite3); static int php_sqlite3_authorizer(void *autharg, int access_type, const char *arg3, const char *arg4, const char *arg5, const char *arg6); static void sqlite3_param_dtor(void *data); -static int php_sqlite3_compare_stmt_zval_free( php_sqlite3_free_list **free_list, zval *statement ); +static int php_sqlite3_compare_stmt_zval_free(php_sqlite3_free_list **free_list, zval *statement); /* {{{ Error Handler */ @@ -149,8 +149,6 @@ PHP_METHOD(sqlite3, open) return; } - db_obj->initialised = 1; - #if SQLITE_HAS_CODEC if (encryption_key_len > 0) { if (sqlite3_key(db_obj->db, encryption_key, encryption_key_len) != SQLITE_OK) { @@ -160,6 +158,8 @@ PHP_METHOD(sqlite3, open) } #endif + db_obj->initialised = 1; + #if PHP_API_VERSION < 20100412 if (PG(safe_mode) || (PG(open_basedir) && *PG(open_basedir))) { #else |