mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: SQLite3: add DEFENSIVE config for SQLite >= 3.26.0 as a mitigation strategy against potential security flaws
This commit is contained in:
commit
e7ce7c6bb2
6 changed files with 75 additions and 0 deletions
|
@ -79,6 +79,9 @@ static void php_sqlite3_error(php_sqlite3_db_object *db_obj, char *format, ...)
|
|||
*/
|
||||
PHP_INI_BEGIN()
|
||||
STD_PHP_INI_ENTRY("sqlite3.extension_dir", NULL, PHP_INI_SYSTEM, OnUpdateString, extension_dir, zend_sqlite3_globals, sqlite3_globals)
|
||||
#if SQLITE_VERSION_NUMBER >= 3026000
|
||||
STD_PHP_INI_ENTRY("sqlite3.defensive", "1", PHP_INI_SYSTEM, OnUpdateBool, dbconfig_defensive, zend_sqlite3_globals, sqlite3_globals)
|
||||
#endif
|
||||
PHP_INI_END()
|
||||
/* }}} */
|
||||
|
||||
|
@ -164,6 +167,12 @@ PHP_METHOD(sqlite3, open)
|
|||
sqlite3_set_authorizer(db_obj->db, php_sqlite3_authorizer, NULL);
|
||||
}
|
||||
|
||||
#if SQLITE_VERSION_NUMBER >= 3026000
|
||||
if (SQLITE3G(dbconfig_defensive)) {
|
||||
sqlite3_db_config(db_obj->db, SQLITE_DBCONFIG_DEFENSIVE, 1, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fullpath != filename) {
|
||||
efree(fullpath);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue