Skip to content

Commit

Permalink
acc: do not crash if context is not available
Browse files Browse the repository at this point in the history
Many thanks go to Norm Brandinger for reporting the bug!
  • Loading branch information
razvancrainea committed Dec 5, 2024
1 parent 3197a61 commit 883e4a2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/acc/acc_logic.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@
tmb.t_ctx_put_ptr(_t, acc_tm_flags_ctx_idx, _ptr)

#define ACC_GET_CTX() \
(acc_ctx_t *)context_get_ptr(CONTEXT_GLOBAL, current_processing_ctx, \
acc_flags_ctx_idx)
(acc_ctx_t *)(current_processing_ctx?\
context_get_ptr(CONTEXT_GLOBAL, current_processing_ctx, \
acc_flags_ctx_idx):NULL)

#define ACC_PUT_CTX(_ptr) \
context_put_ptr(CONTEXT_GLOBAL, current_processing_ctx, \
Expand Down

0 comments on commit 883e4a2

Please sign in to comment.