Merge branch 'PHP-8.1'

* PHP-8.1:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
This commit is contained in:
Christoph M. Becker 2022-07-27 13:11:58 +02:00
commit a398a2fd3d
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
4 changed files with 57 additions and 1 deletions

View file

@ -2067,6 +2067,9 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c
/* Check open_basedir restrictions first */
if (PG(open_basedir) && *PG(open_basedir)) {
if (action == SQLITE_ATTACH) {
if (!arg1) {
return SQLITE_DENY;
}
if (memcmp(arg1, ":memory:", sizeof(":memory:")) && *arg1) {
if (strncmp(arg1, "file:", 5) == 0) {
/* starts with "file:" */