]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip_t38: Don't crash on authenticated reinvite after originated T.38 FAX. 38/238/3
authorMark Michelson <mmichelson@digium.com>
Thu, 23 Apr 2015 17:54:30 +0000 (12:54 -0500)
committerJoshua Colp <jcolp@digium.com>
Thu, 23 Apr 2015 18:10:47 +0000 (13:10 -0500)
commit008076ecf45fc5706aba43ebc399a05c119b22e3
tree45ff1369f3240b7b7694e766d2d9b9bee02293b7
parentd7e82690f1782c28c64bd71992ae376b8f90cc8e
res_pjsip_t38: Don't crash on authenticated reinvite after originated T.38 FAX.

When Asterisk originates a channel to an application, the channel is
hung up once the application finishes executing. When the application
in question is SendFax, the Asterisk PJSIP code will attempt to reinvite
the T.38 session to audio after the FAX completes. The hangup of the
channel happens in the midst of this reinvite transaction. In most
circumstances, this works out okay because the BYE is delayed until the
reinvite transaction can complete.

However, if the reinvite that Asterisk sends receives a 401/407
response, then Asterisk's attempt to re-send the reinvite with
authentication will fail. This is because the session supplement in
res_pjsip_t38 makes the assumption that the channel on the session will
always be non-NULL. Since the channel has been hung up, though, the
channel is now NULL. Attempting to operate on the channel causes a
crash.

This patch fixes the issue by ensuring that the channel on the session
is not NULL before attempting to mess with the T.38 framehook.

This patch also contains some corrections for comments that were
incorrect and really confused me when I first started looking at the
code.

ASTERISK-25004 #close
Reported by Mark Michelson

Change-Id: Ic5a1230668369dda4bb13524098aed9306ab45a0
res/res_pjsip_t38.c