]> 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 16:57:26 +0000 (16:57 +0000)
committerJonathan Rose <jrose@digium.com>
Wed, 5 Dec 2012 16:57:26 +0000 (16:57 +0000)
commit6c2c8d5a58fb97231e4bb29d6691c0b5809a10e1
tree8b684927f8ca812dc4af730b261421b8f71f3a4e
parent9e948f4bce5894684287c5281ad4dc1e7afa45f5
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

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