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

b2b_logic: saftey check on old_entity->peer #2999

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 11 additions & 8 deletions modules/b2b_logic/bridging.c
Original file line number Diff line number Diff line change
Expand Up @@ -2151,16 +2151,19 @@ int b2bl_bridge_msg(struct sip_msg* msg, str* key, int entity_no, str *adv_ct)
}
old_entity->disconnected = 1;
}
if (old_entity->peer->peer == old_entity)
old_entity->peer->peer = NULL;
else
if (old_entity->peer)
{
LM_ERR("Unexpected chain: old_entity=[%p] and "
"old_entity->peer->peer=[%p]\n",
old_entity, old_entity->peer->peer);
goto error;
if (old_entity->peer->peer == old_entity)
old_entity->peer->peer = NULL;
else
{
LM_ERR("Unexpected chain: old_entity=[%p] and "
"old_entity->peer->peer=[%p]\n",
old_entity, old_entity->peer->peer);
goto error;
}
old_entity->peer = NULL;
}
old_entity->peer = NULL;

/* remove the disconected entity from the tuple */
if(0 == b2bl_drop_entity(old_entity, tuple))
Expand Down