File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ PHP NEWS
1919 . Fixed bug GH-17408 (Assertion failure Zend/zend_exceptions.c).
2020 (nielsdos, ilutov)
2121 . Fix may_have_extra_named_args flag for ZEND_AST_UNPACK. (nielsdos)
22+ . Fix NULL arithmetic in System V shared memory emulation for Windows. (cmb)
2223
2324- DOM:
2425 . Fixed bug GH-17397 (Assertion failure ext/dom/php_dom.c). (nielsdos)
Original file line number Diff line number Diff line change @@ -402,19 +402,21 @@ static shm_pair *shm_get(key_t key, void *addr)
402402 shm_pair * ptr ;
403403 shm_pair * newptr ;
404404
405- for (ptr = TWG (shm ); ptr < (TWG (shm ) + TWG (shm_size )); ptr ++ ) {
406- if (!ptr -> descriptor ) {
407- continue ;
408- }
409- if (!addr && ptr -> descriptor -> shm_perm .key == key ) {
410- break ;
411- } else if (ptr -> addr == addr ) {
412- break ;
405+ if (TWG (shm ) != NULL ) {
406+ for (ptr = TWG (shm ); ptr < (TWG (shm ) + TWG (shm_size )); ptr ++ ) {
407+ if (!ptr -> descriptor ) {
408+ continue ;
409+ }
410+ if (!addr && ptr -> descriptor -> shm_perm .key == key ) {
411+ break ;
412+ } else if (ptr -> addr == addr ) {
413+ break ;
414+ }
413415 }
414- }
415416
416- if (ptr < (TWG (shm ) + TWG (shm_size ))) {
417- return ptr ;
417+ if (ptr < (TWG (shm ) + TWG (shm_size ))) {
418+ return ptr ;
419+ }
418420 }
419421
420422 newptr = (shm_pair * )realloc ((void * )TWG (shm ), (TWG (shm_size )+ 1 )* sizeof (shm_pair ));
You can’t perform that action at this time.
0 commit comments