]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
func_scramble: Fix null pointer dereference.
authorNaveen Albert <asterisk@phreaknet.org>
Sat, 10 Sep 2022 15:15:08 +0000 (15:15 +0000)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Thu, 22 Sep 2022 16:26:05 +0000 (11:26 -0500)
Fix segfault due to null pointer dereference
inside the audiohook callback.

ASTERISK-30220 #close

Change-Id: Ideb80f606974366e89d619d908744230b5a5a259

funcs/func_scramble.c

index 5fe194cd15f3dbe4f767966a130e0b8fb90ca7c1..e055b2dc8a216dc74459481e56876d2843e4f4cd 100644 (file)
@@ -125,6 +125,7 @@ static int scramble_callback(struct ast_audiohook *audiohook, struct ast_channel
        }
 
        if (frame->frametype == AST_FRAME_VOICE) { /* only invert voice frequencies */
+               ni = datastore->data;
                /* Based on direction of frame, and confirm it is applicable */
                if (!(direction == AST_AUDIOHOOK_DIRECTION_READ ? ni->rx : ni->tx)) {
                        return 0;