mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Prevent closing of unrelated handles
If our `shmget()` fails for certain reasons, the segment handle is closed. However, the handle might be reused by Windows, and as such we must not close it again when shutting down the TSRM. Closes GH-15984.
This commit is contained in:
parent
018c0b3d14
commit
f303840a86
2 changed files with 4 additions and 0 deletions
3
NEWS
3
NEWS
|
@ -30,6 +30,9 @@ PHP NEWS
|
|||
. Fixed bugs GH-15908 and GH-15026 (leak / assertion failure in streams.c).
|
||||
(nielsdos)
|
||||
|
||||
- TSRM:
|
||||
. Prevent closing of unrelated handles. (cmb)
|
||||
|
||||
- XML:
|
||||
. Fixed bug GH-15868 (Assertion failure in xml_parse_into_struct after
|
||||
exception). (nielsdos)
|
||||
|
|
|
@ -707,6 +707,7 @@ TSRM_API int shmget(key_t key, size_t size, int flags)
|
|||
if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) {
|
||||
if (NULL != shm->segment) {
|
||||
CloseHandle(shm->segment);
|
||||
shm->segment = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
UnmapViewOfFile(shm->descriptor);
|
||||
shm->descriptor = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue