1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

nullify the memory chunk to avoid crashes when freeing resource

This commit is contained in:
Anatol Belski
2015-09-22 20:33:46 +02:00
parent 0e843a4582
commit faa50318a3

View File

@@ -437,6 +437,7 @@ static shm_pair *shm_get(int key, void *addr)
TWG(shm) = newptr;
ptr = newptr + TWG(shm_size);
TWG(shm_size)++;
memset(ptr, 0, sizeof(*ptr));
return ptr;
}