File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1361,9 +1361,15 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
1361
1361
#ifdef __SSE2__
1362
1362
/* Align to 64-byte boundary */
1363
1363
ZCG (mem ) = zend_shared_alloc (memory_used + 64 );
1364
- ZCG (mem ) = (void * )(((zend_uintptr_t )ZCG (mem ) + 63L ) & ~63L );
1364
+ if (ZCG (mem )) {
1365
+ memset (ZCG (mem ), 0 , memory_used + 64 );
1366
+ ZCG (mem ) = (void * )(((zend_uintptr_t )ZCG (mem ) + 63L ) & ~63L );
1367
+ }
1365
1368
#else
1366
1369
ZCG (mem ) = zend_shared_alloc (memory_used );
1370
+ if (ZCG (mem )) {
1371
+ memset (ZCG (mem ), 0 , memory_used );
1372
+ }
1367
1373
#endif
1368
1374
if (!ZCG (mem )) {
1369
1375
zend_shared_alloc_destroy_xlat_table ();
@@ -2542,6 +2548,7 @@ static int zend_accel_init_shm(void)
2542
2548
zend_shared_alloc_unlock ();
2543
2549
return FAILURE ;
2544
2550
}
2551
+ memset (accel_shared_globals , 0 , sizeof (zend_accel_shared_globals ));
2545
2552
ZSMMG (app_shared_globals ) = accel_shared_globals ;
2546
2553
2547
2554
zend_accel_hash_init (& ZCSG (hash ), ZCG (accel_directives ).max_accelerated_files );
Original file line number Diff line number Diff line change @@ -230,6 +230,7 @@ int zend_shared_alloc_startup(size_t requested_size)
230
230
zend_accel_error (ACCEL_LOG_FATAL , "Insufficient shared memory!" );
231
231
return ALLOC_FAILURE ;;
232
232
}
233
+ memset (p_tmp_shared_globals , 0 , sizeof (zend_smm_shared_globals ));
233
234
234
235
tmp_shared_segments = zend_shared_alloc (shared_segments_array_size + ZSMMG (shared_segments_count ) * sizeof (void * ));
235
236
if (!tmp_shared_segments ) {
@@ -325,7 +326,6 @@ void *zend_shared_alloc(size_t size)
325
326
326
327
ZSMMG (shared_segments )[i ]-> pos += block_size ;
327
328
ZSMMG (shared_free ) -= block_size ;
328
- memset (retval , 0 , block_size );
329
329
ZEND_ASSERT (((zend_uintptr_t )retval & 0x7 ) == 0 ); /* should be 8 byte aligned */
330
330
return retval ;
331
331
}
You can’t perform that action at this time.
0 commit comments