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

Only update the TM UAS if we are in request context and not fake request #3447

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vladpaiu
Copy link
Member

Summary
Fix crashing of OpenSIPS when script writer mistakenly runs async in branch route and/or event route

Details
In case of push notifications injecting branches, and if in branch_route the script writer does async() calls, OpenSIPS will update the UAS with information from the fake request ( which might contain new branch lumps and other changes ). In case there are multiple branches, post_print_uac_request will try to free up the new request and find old SHM branches and crash in

    /* delete inserted branch lumps */
    del_flaged_lumps( &request->add_rm, LUMPFLAG_BRANCH);
    del_flaged_lumps( &request->body_lumps, LUMPFLAG_BRANCH);

Solution
Only update the UAS if we are running in request route and we are not having a fake request in hand.

Compatibility
Backwards compatible

@vladpaiu vladpaiu added the bug label Aug 22, 2024
@vladpaiu vladpaiu added this to the 3.6-dev milestone Aug 22, 2024
Copy link

Any updates here? No progress has been made in the last 30 days, marking as stale.

@github-actions github-actions bot added the stale label Sep 22, 2024
@@ -249,7 +249,7 @@ int t_handle_async(struct sip_msg *msg, struct action* a,
} else {
/* update the cloned UAS (from transaction)
* with data from current msg */
if (t->uas.request)
if ((t->uas.request) && (route_type==REQUEST_ROUTE) && ((msg->msg_flags & FL_TM_FAKE_REQ) == 0))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be just if ((t->uas.request) && !(msg->msg_flags & FL_TM_FAKE_REQ)) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants