Merge branch 'PHP-8.2' into PHP-8.3

* PHP-8.2:
  Fix GH-12974: Apache crashes on shutdown when using pg_pconnect()
This commit is contained in:
Niels Dossche 2023-12-27 20:16:32 +01:00
commit 42575ac966
3 changed files with 20 additions and 3 deletions

5
NEWS
View File

@ -38,6 +38,9 @@ PHP NEWS
. Fixed bug GH-12936 (hash() function hangs endlessly if using sha512 on
strings >= 4GiB). (nielsdos)
- ODBC:
. Fix crash on Apache shutdown with persistent connections. (nielsdos)
- Opcache:
. Fixed oss-fuzz #64727 (JIT undefined array key warning may overwrite DIM
with NULL when DIM is the same var as result). (ilutov)
@ -58,6 +61,8 @@ PHP NEWS
- PGSQL:
. Fixed auto_reset_persistent handling and allow_persistent type. (David Carlier)
. Fixed bug GH-12974 (Apache crashes on shutdown when using pg_pconnect()).
(nielsdos)
- PHPDBG:
. Fixed bug GH-12962 (Double free of init_file in phpdbg_prompt.c). (nielsdos)

View File

@ -168,7 +168,13 @@ static void _close_odbc_conn(zend_resource *rsrc)
SQLFreeEnv(conn->henv);
}
efree(conn);
ODBCG(num_links)--;
/* See https://github.com/php/php-src/issues/12974 why we need to check the if */
#ifdef ZTS
if (odbc_module_entry.module_started)
#endif
{
ODBCG(num_links)--;
}
}
/* }}} */

View File

@ -315,8 +315,14 @@ static void _close_pgsql_plink(zend_resource *rsrc)
PQclear(res);
}
PQfinish(link);
PGG(num_persistent)--;
PGG(num_links)--;
/* See https://github.com/php/php-src/issues/12974 why we need to check the if */
#ifdef ZTS
if (pgsql_module_entry.module_started)
#endif
{
PGG(num_persistent)--;
PGG(num_links)--;
}
rsrc->ptr = NULL;
}