- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8k
 
Fix GH-20194: null offset deprecation not emitted for writes #20238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 
           Not approving as it's still in draft, but looks good. Thanks for taking care of this!  | 
    
19555de    to
    aca79f0      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
| } else if (UNEXPECTED(Z_TYPE_P(offset) == IS_NULL)) { | ||
| zend_error(E_DEPRECATED, "Using null as an array offset is deprecated, use an empty string instead"); | ||
| if (UNEXPECTED(EG(exception))) { | ||
| zval_ptr_dtor_nogc(expr_ptr); | ||
| HANDLE_EXCEPTION(); | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know, each new warning opens a way to modify some involved zval through the user error handler.
In this case, user error handler may probably unset() op1 and this may lead to use-after-free on attempt to add new element.
It's better to add related test(s) and fix problem at first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a test case and fix.
ddfec36    to
    6edd455      
    Compare
  
    This is used by array_column(), the AST, and iterators
6edd455    to
    70b2fda      
    Compare
  
    
Based on the patch from @nielsdos and split into different commits to explain what affects what.