Fix GH-20042: SEGV in array.c when error handler clobbers IAP object#21461
Fix GH-20042: SEGV in array.c when error handler clobbers IAP object#21461iliaal wants to merge 1 commit intophp:masterfrom
Conversation
get_ht_for_iap() emits a deprecation notice for object arguments, which can trigger a user error handler that modifies the by-reference variable. After the handler returns, the zval may no longer be an object, causing a segfault when accessing it as one. Re-check the zval type after emitting the deprecation and bail out if it was clobbered.
|
Hi @iliaal. As #20042 (comment) mentions, we generally don't try to fix |
Any particular reason (for future reference)? That being said, the change is fairly benign and covers all the by-ref array functions. |
|
Mainly because there are endless ways in which |
|
Fair point, the only reason I tried to tackle it is cause of Segv. I'd say small point fixes (just a |
IMO it's not worth the hassle, but I don't have any special privileges and won't object if somebody else would like to merge it. If more time is invested, it's probably better to try to finish GH-12805 so that this class of issues is solved completely. There are other similar classes (e.g. |
Summary
get_ht_for_iap()emits a deprecation for object IAP args, triggering the user error handler. If the handler clobbers the by-ref variable, the code reads a dead zval as an object pointer and segfaults.Fixes #20042