]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_srtp: Fix a crash caused by srtp_dealloc on an already dealloced session
authorJonathan Rose <jrose@digium.com>
Wed, 5 Dec 2012 17:08:12 +0000 (17:08 +0000)
committerJonathan Rose <jrose@digium.com>
Wed, 5 Dec 2012 17:08:12 +0000 (17:08 +0000)
commite875e4b2c081146254d88adb9463eb087ca51c09
treeb046cab46b6683ef87d7ba0971094ffa766d576d
parenteb3a88351a5576ca07797ca19674eb35602dafa2
res_srtp: Fix a crash caused by srtp_dealloc on an already dealloced session

When srtp_create fails, the session may be dealloced or just not alloced. At
the same time though, the session pointer might not be set to NULL in this
process and attempting to srtp_dealloc it again will cause a segfault. This
patch checks for failure of srtp_create and sets the session pointer to NULL
if it fails.

(closes issue ASTERISK-20499)
Reported by: tootai
Review: https://reviewboard.asterisk.org/r/2228/
........

Merged revisions 377256 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 377261 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@377262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_srtp.c