]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Copy default_from_user to avoid crash. 35/1235/1
authorMark Michelson <mmichelson@digium.com>
Thu, 10 Sep 2015 14:49:45 +0000 (09:49 -0500)
committerMark Michelson <mmichelson@digium.com>
Thu, 10 Sep 2015 14:49:45 +0000 (09:49 -0500)
commit9d1f176e292a17e6cda05664fefab62c11761d05
treeae31ea8b180b43d7a5091efdbf9afb5c8b4f2370
parent16fa1cbb6c082210a2f2da587ad9563674e88da5
res_pjsip: Copy default_from_user to avoid crash.

The default_from_user retrieval function was pulling the
default_from_user from the global configuration struct in an unsafe way.
If using a database as a backend configuration store, the global
configuration struct is short-lived, so grabbing a pointer from it
results in referencing freed memory.

The fix here is to copy the default_from_user value out of the global
configuration struct.

Thanks go to John Hardin for discovering this problem and proposing the
patch on which this fix is based.

ASTERISK-25390 #close
Reported by Mark Michelson

Change-Id: I6b96067a495c1259da768f4012d44e03e7c6148c
include/asterisk/res_pjsip.h
res/res_pjsip.c
res/res_pjsip/config_global.c