com php-src: nullify the memory chunk to avoid crashes when freeing resource: TSRM/tsrm_win32.c
| From: | Anatol Belski | Date: | Tue, 22 Sep 2015 18:33:46 +0000 |
| Subject: | com php-src: nullify the memory chunk to avoid crashes when freeing resource: TSRM/tsrm_win32.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89117@lists.php.net to get a copy of this message | ||
Commit: faa50318a39503e65acf3958e0c10698f5c6f80f
Author: Anatol Belski <ab@php.net> Tue, 22 Sep 2015 20:33:46 +0200
Parents: 0e843a45820941345d1b1695040ab699cf3a0b2a
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=faa50318a39503e65acf3958e0c10698f5c6f80f
Log:
nullify the memory chunk to avoid crashes when freeing resource
Changed paths:
M TSRM/tsrm_win32.c
Diff:
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 285ab61..42a7294 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -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;
}