Ticket #1946 (closed defect: fixed)
Assertion in deinitializing client auth session when dialog creation fails
|Reported by:||nanang||Owned by:||bennylp|
|Backport to 1.x milestone:||Backported:||no|
Reported that a segmentation fault occurs after upgrading to PJSIP 2.5.5 and the investigation leads to deinitialization of uninitialized client auth session when dialog creation fails.
Note that pjsip_auth_clt_deinit() has this validity check:
PJ_ASSERT_RETURN(sess && sess->endpt, PJ_EINVAL);
and in dialog creation, sess->endpt should be NULL when client auth session is uninitialized. So the deinitialization of uninitialized session will raise assertion on debug mode, or return error on NDEBUG mode, or crash when accessing NULL pointer when PJ_ENABLE_EXTRA_CHECK is turned off.
Thanks to Pirmin Walthert for the report and the analysis. Original report can be found here.