]> git.ipfire.org Git - thirdparty/asterisk.git/commit
core/frame: Fix ast_frdup() and ast_frisolate() for empty text frames
authorneutrino88 <emmanuel.buu@ives.fr>
Tue, 25 Sep 2018 21:19:36 +0000 (17:19 -0400)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 2 Oct 2018 16:24:10 +0000 (11:24 -0500)
commit3d03fca94acb556c1ea803feef0030c915b09dad
treec3e2c0991a37c96f5692e074115b104c7562e0ab
parent594bbbea57279617bc57dbe29eb96bd8c8b0c8b8
core/frame: Fix ast_frdup() and ast_frisolate() for empty text frames

If a channel creates an AST_TEXT_FRAME with datalen == 0, the ast_frdup()
and ast_frisolate() functions could create a clone frame with an invalid
data.ptr which would cause a crash.  The proposed fix is to make sure that
for such empty text frames, ast_frdup() and ast_frisolate() return cloned
text frames with a valid data.ptr.

ASTERISK-28076
Reported by: Emmanuel BUU
Tested by: Emmanuel BUU

Change-Id: Ib882dd028598f13c4c233edbfdd7e54ad44a68e9
main/frame.c