Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing null check for on_ip_changed_progress callback #3830

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions pjsip/src/pjsua-lib/pjsua_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3985,7 +3985,6 @@ PJ_DEF(pj_status_t) pjsua_handle_ip_change(const pjsua_ip_change_param *param)
/* Shutdown all TCP/TLS transports */
if (param->shutdown_transport) {
pjsip_tpmgr_shutdown_param param;
pjsua_ip_change_op_info info;

pjsip_tpmgr_shutdown_param_default(&param);
param.include_udp = PJ_FALSE;
Expand All @@ -3998,10 +3997,14 @@ PJ_DEF(pj_status_t) pjsua_handle_ip_change(const pjsua_ip_change_param *param)
/* Provide dummy info instead of NULL info to avoid possible crash
* (if app does not check).
*/
pj_bzero(&info, sizeof(info));
pjsua_var.ua_cfg.cb.on_ip_change_progress(
PJSUA_IP_CHANGE_OP_SHUTDOWN_TP,
status, &info);
if (pjsua_var.ua_cfg.cb.on_ip_change_progress) {
pjsua_ip_change_op_info info;

pj_bzero(&info, sizeof(info));
pjsua_var.ua_cfg.cb.on_ip_change_progress(
PJSUA_IP_CHANGE_OP_SHUTDOWN_TP,
status, &info);
}
}

if (param->restart_listener) {
Expand Down
Loading