-
Notifications
You must be signed in to change notification settings - Fork 806
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
PJSUA2 Crash Fix with CallSetting::fromPj #4056
Conversation
…all-ID on outgoing INVITE
… formatting issues on column width
…->custom_call_id = pj_str) - pjStr just checks the ptr and not slen -- since bzero just sets the length - we have a crash.
Since PJSIP 2.7, actually pjproject/pjsip/src/pjsua2/util.hpp Lines 37 to 42 in aa56436
|
Btw, the |
@nanangizz Yes - looking at it now. Possibly I am incorrect. I am stumped. After a pjsua_call_hangup it occurs.
It is intermittent. Not consistently reproducible. Trying to track it down. |
So the pj_str However, the length of the string Technically to do an outbound call you can remove Still looking at the call flow and trying to figure out where the release is. |
@nanangizz At some point However, Any thoughts on where |
Ah right, the pjproject/pjsip/src/pjsua-lib/pjsua_call.c Lines 962 to 965 in aa56436
Btw, while here, please also fix the log printing line, the column width is > 80. Thanks :) |
…create dangling pointer after outbound INVITE goes out
Thanks @nanangizz for the information on the shallow copy. This definitely explains it. Ive done the requested changes. Ran a few tests and this seems to solve the issue. This prevents the crash if |
@nanangizz Great - Thank you - When |
@nanangizz Crash occured with pjsua2 cpp api.
It appears bzero does not do any allocation of the string -- so pj2Str() is crashing since it does not check the length of the string. It simply checks the pointer.
During the review process my initialization of
pjsua_call_setting
includedopt->custom_call_id = pj_str("");
which would set the pointer.
This was removed to due to an optimization since
bzero
was being applied to thepjsua_call_setting
structure and it was thought unnecessary. However, this is required if you are callingpj2Str
.Simple fix applied to call.cpp is check the length before calling pj2Str:
FROM:
Crash:
Please let me know if you'd like for me to do a separate fork with the single change.