Skip to content

Commit 2684d6d

Browse files
committed
fix(agent): nr_execute_handle_autoload needs null check for txn
nr_execute_handle_autoload wasn't accounting for the possibility of txn being null.
1 parent ae34b4f commit 2684d6d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

agent/php_execute.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,14 @@ static void nr_execute_handle_autoload(const char* filename,
891891
return;
892892
}
893893

894+
/*
895+
* There is a possibility of the txn being NULL if nr_php_end_txn has been called.
896+
* Verify txn is not null before dereferencing and continuing on.
897+
*/
898+
if (NULL == NRPRG(txn)) {
899+
return;
900+
}
901+
894902
if (NRPRG(txn)->composer_info.autoload_detected) {
895903
// autoload already handled
896904
return;

0 commit comments

Comments
 (0)