Skip to content

Commit

Permalink
Check observer_class_lookup for NULL in observer callback (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoallikmaa authored Oct 18, 2023
1 parent eb20383 commit 9410829
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ext/otel_observer.c
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,15 @@ static otel_observer *resolve_observer(zend_execute_data *execute_data) {

static zend_observer_fcall_handlers
observer_fcall_init(zend_execute_data *execute_data) {
// This means that either RINIT has not yet been called, or RSHUTDOWN has
// already been called. The former can happen if another extension that is
// loaded before this one invokes PHP functions in its RINIT. The latter
// can happen if a header callback is set or when another extension invokes
// PHP functions in their RSHUTDOWN.
if (OTEL_G(observer_class_lookup) == NULL) {
return (zend_observer_fcall_handlers){NULL, NULL};
}

if (op_array_extension == -1) {
return (zend_observer_fcall_handlers){NULL, NULL};
}
Expand Down

0 comments on commit 9410829

Please sign in to comment.