[Asterisk-code-review] func_scramble: Fix null pointer dereference. (asterisk[16])

N A asteriskteam at digium.com
Wed Sep 21 16:28:38 CDT 2022


N A has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/19285 )


Change subject: func_scramble: Fix null pointer dereference.
......................................................................

func_scramble: Fix null pointer dereference.

Fix segfault due to null pointer dereference
inside the audiohook callback.

ASTERISK-30220 #close

Change-Id: Ideb80f606974366e89d619d908744230b5a5a259
---
M funcs/func_scramble.c
1 file changed, 15 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/85/19285/1

diff --git a/funcs/func_scramble.c b/funcs/func_scramble.c
index 5fe194c..e055b2d 100644
--- a/funcs/func_scramble.c
+++ b/funcs/func_scramble.c
@@ -125,6 +125,7 @@
 	}
 
 	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;

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/19285
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ideb80f606974366e89d619d908744230b5a5a259
Gerrit-Change-Number: 19285
Gerrit-PatchSet: 1
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220921/08274c31/attachment.html>


More information about the asterisk-code-review mailing list