[Asterisk-code-review] chan sip.c: Update dialog fromtag after request with auth (asterisk[11])

Richard Mudgett asteriskteam at digium.com
Thu Jun 11 16:35:17 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: chan_sip.c: Update dialog fromtag after request with auth
......................................................................


Patch Set 3: Code-Review-1

(3 comments)

https://gerrit.asterisk.org/#/c/632/3//COMMIT_MSG
Commit Message:

Line 7: chan_sip.c: Update dialog fromtag after request with auth
Please note that the commit message was edited in this review so you need to preserve the contents for the next review update.


https://gerrit.asterisk.org/#/c/632/3/channels/chan_sip.c
File channels/chan_sip.c:

Line 9116: 						&& strcmp(args.fromtag, sip_pvt_ptr.theirtag)) {
This isn't going to compile:
sip_pvt_ptr->theirtag


Line 9115: 				if (args.method != SIP_RESPONSE && args.authentication_present
         : 						&& strcmp(args.fromtag, sip_pvt_ptr.theirtag)) {
         : 					/* If we have a request that uses athentication and the fromtag is
         : 					 * different from that in the original call dialog, update the
         : 					 * fromtag in the saved call dialog */
         : 					sip_pvt_lock(sip_pvt_ptr);
         : 					ast_string_field_set(sip_pvt_ptr, theirtag, args.fromtag);
         : 					sip_pvt_unlock(sip_pvt_ptr);
         : 				}
The sip_pvt_ptr lock should be held around the entire if statement.  You are accessing sip_pvt_ptr->theirtag while unlocked.

lock sip_pvt_ptr
if () {
}
unlock sip_pvt_ptr


-- 
To view, visit https://gerrit.asterisk.org/632
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I5c16cf3b409e5ef9f2b2fe974b6bd2a45a6aa17e
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Damian Ivereigh <damo at launtel.net.au>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list