Skip to content

Commit

Permalink
Fix the info_cnt of pjsip_dlg_event_status when parsing (#4214)
Browse files Browse the repository at this point in the history
  • Loading branch information
trengginas authored Dec 16, 2024
1 parent 484c6b6 commit 3accf04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pjsip/include/pjsip-simple/dlg_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ PJ_DECL(pjsip_module*) pjsip_bdlg_event_instance(void);
* Maximum dialog event status info items which can handled by application.
*
*/
#define PJSIP_DLG_EVENT_STATUS_MAX_INFO 8
#define PJSIP_DLG_EVENT_STATUS_MAX_INFO 1


/**
Expand Down
4 changes: 2 additions & 2 deletions pjsip/src/pjsip-simple/dlg_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,11 @@ pjsip_dlg_event_parse_dialog_info2(char *body, unsigned body_len,
pjsip_dlg_info_dialog_info *dialog_info;
pjsip_dlg_info_dialog *dialog;

dlgev_st->info_cnt = 0;
dialog_info = pjsip_dlg_info_parse(pool, body, body_len);
if (dialog_info == NULL)
return PJSIP_SIMPLE_EBADPIDF;

dlgev_st->info_cnt = 0;

dialog = pjsip_dlg_info_dialog_info_get_dialog(dialog_info);
pj_strdup(pool, &dlgev_st->info[dlgev_st->info_cnt].dialog_info_entity,
pjsip_dlg_info_dialog_info_get_entity(dialog_info));
Expand Down Expand Up @@ -402,6 +401,7 @@ pjsip_dlg_event_parse_dialog_info2(char *body, unsigned body_len,
} else {
dlgev_st->info[dlgev_st->info_cnt].dialog_node = NULL;
}
dlgev_st->info_cnt++;

return PJ_SUCCESS;
}
Expand Down

0 comments on commit 3accf04

Please sign in to comment.