[Asterisk-code-review] res/res pjsip: Fix crash due to misuse of session->media bet... (asterisk[13])

Joshua C. Colp asteriskteam at digium.com
Tue Jan 22 10:50:05 CST 2019


Joshua C. Colp has posted comments on this change. ( https://gerrit.asterisk.org/10601 )

Change subject: res/res_pjsip: Fix crash due to misuse of session->media between threads.
......................................................................


Patch Set 6: Code-Review-1

(5 comments)

https://gerrit.asterisk.org/#/c/10601/6/res/res_pjsip_t38.c
File res/res_pjsip_t38.c:

https://gerrit.asterisk.org/#/c/10601/6/res/res_pjsip_t38.c@89
PS6, Line 89: 	.type = "session_media",
This is really specific to t38, so it should be named such just in case for the future.


https://gerrit.asterisk.org/#/c/10601/6/res/res_pjsip_t38.c@137
PS6, Line 137: 	RAII_VAR(struct ast_datastore *, datastore, ast_sip_session_get_datastore(session, "session_media"), ao2_cleanup);
There's no need to use a RAII_VAR here - you can ao2_ref inside the if for datastore


https://gerrit.asterisk.org/#/c/10601/6/res/res_pjsip_t38.c@157
PS6, Line 157: 	datastore->data = session_media;
You can use ao2_bump here, it also makes it clear that the ref is for the datastore


https://gerrit.asterisk.org/#/c/10601/6/res/res_pjsip_t38.c@490
PS6, Line 490: 		RAII_VAR(struct ast_sip_session_media *, session_media,
There's no need to use a RAII_VAR here, an ao2_cleanup afterwards is fine.


https://gerrit.asterisk.org/#/c/10601/6/res/res_pjsip_t38.c@506
PS6, Line 506: 		RAII_VAR(struct ast_sip_session_media *, session_media,
There's no need to use a RAII_VAR here, an ao2_cleanup afterwards is fine.



-- 
To view, visit https://gerrit.asterisk.org/10601
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia92e2389b8d804bf205473e92ec06217e87ce237
Gerrit-Change-Number: 10601
Gerrit-PatchSet: 6
Gerrit-Owner: Paulo Vicentini <paulo.vicentini at gmail.com>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: Joshua C. Colp <jcolp at digium.com>
Gerrit-Reviewer: Matthew Fredrickson <creslin at digium.com>
Gerrit-Reviewer: Paulo Vicentini <paulo.vicentini at gmail.com>
Gerrit-Reviewer: Torrey Searle <tsearle at gmail.com>
Gerrit-Comment-Date: Tue, 22 Jan 2019 16:50:05 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190122/5d17aefc/attachment-0001.html>


More information about the asterisk-code-review mailing list