From: Naveen Albert Date: Sat, 10 Sep 2022 15:15:08 +0000 (+0000) Subject: func_scramble: Fix null pointer dereference. X-Git-Tag: 18.16.0-rc1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22b46f2a151bc17eccc460649a6c70c551cd4513;p=thirdparty%2Fasterisk.git func_scramble: Fix null pointer dereference. Fix segfault due to null pointer dereference inside the audiohook callback. ASTERISK-30220 #close Change-Id: Ideb80f606974366e89d619d908744230b5a5a259 --- diff --git a/funcs/func_scramble.c b/funcs/func_scramble.c index 5fe194cd15..e055b2dc8a 100644 --- a/funcs/func_scramble.c +++ b/funcs/func_scramble.c @@ -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;