Skip to content

Commit 772edad

Browse files
committed
Add entropy when observer extension enabled
1 parent e13b014 commit 772edad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Zend/zend_system_id.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "php.h"
1919
#include "zend_system_id.h"
2020
#include "zend_extensions.h"
21+
#include "zend_observer.h"
2122
#include "ext/standard/md5.h"
2223
#include "ext/hash/php_hash.h"
2324

@@ -59,6 +60,7 @@ void zend_startup_system_id(void)
5960
#define ZEND_HOOK_COMPILE_FILE (1 << 1)
6061
#define ZEND_HOOK_EXECUTE_EX (1 << 2)
6162
#define ZEND_HOOK_EXECUTE_INTERNAL (1 << 3)
63+
#define ZEND_HOOK_OBSERVER (1 << 4)
6264

6365
void zend_finalize_system_id(void)
6466
{
@@ -78,6 +80,9 @@ void zend_finalize_system_id(void)
7880
if (zend_execute_internal) {
7981
hooks |= ZEND_HOOK_EXECUTE_INTERNAL;
8082
}
83+
if (ZEND_OBSERVER_ENABLED) {
84+
hooks |= ZEND_HOOK_OBSERVER;
85+
}
8186
PHP_MD5Update(&context, &hooks, sizeof(zend_uchar));
8287

8388
for (; i < 256; i++) {

0 commit comments

Comments
 (0)