Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fix GH-9032: SQLite3 authorizer crashes on NULL values
This commit is contained in:
Christoph M. Becker 2022-07-27 13:05:30 +02:00
commit ca84d06bbc
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
5 changed files with 64 additions and 2 deletions

View file

@ -2034,6 +2034,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:" */