Skip to content

Commit

Permalink
dialog: prevent crash when running in auto-CANCEL mode
Browse files Browse the repository at this point in the history
When auto-CANCEL mode is enabled, the node that receives the replicated
CANCEL does not have a processing context, since it is running out of
the script context. This patch prevents OpenSIPS from crashing.

Reported by Pasan Meemaduma (pasanmdev on GitHub) in #1719
  • Loading branch information
razvancrainea committed May 31, 2019
1 parent 5c65090 commit 603a493
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/dialog/dlg_handlers.c
Expand Up @@ -514,7 +514,7 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)
}
}

if ( ctx_dialog_get()==NULL) {
if (current_processing_ctx && ctx_dialog_get()==NULL) {
/* reference and attached to script */
ref_dlg(dlg,1);
ctx_dialog_set(t->dialog_ctx);
Expand Down

0 comments on commit 603a493

Please sign in to comment.