[Asterisk-code-review] channels: Don't dereference NULL pointer (asterisk[18])
George Joseph
asteriskteam at digium.com
Wed Sep 30 08:25:53 CDT 2020
George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15006 )
Change subject: channels: Don't dereference NULL pointer
......................................................................
channels: Don't dereference NULL pointer
Check result of ast_translator_build_path against NULL before dereferencing.
ASTERISK-29091
Change-Id: Ia3538ea190bd371f70c9dd49984b021765691b29
---
M main/channel.c
1 file changed, 6 insertions(+), 2 deletions(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
diff --git a/main/channel.c b/main/channel.c
index 276c1bc..d75c615 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -5709,11 +5709,15 @@
if (!direction) {
/* reading */
trans_pvt = ast_translator_build_path(best_set_fmt, best_native_fmt);
- trans_pvt->interleaved_stereo = 0;
+ if (trans_pvt) {
+ trans_pvt->interleaved_stereo = 0;
+ }
} else {
/* writing */
trans_pvt = ast_translator_build_path(best_native_fmt, best_set_fmt);
- trans_pvt->interleaved_stereo = interleaved_stereo;
+ if (trans_pvt) {
+ trans_pvt->interleaved_stereo = interleaved_stereo;
+ }
}
access->set_trans(chan, trans_pvt);
res = trans_pvt ? 0 : -1;
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15006
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ia3538ea190bd371f70c9dd49984b021765691b29
Gerrit-Change-Number: 15006
Gerrit-PatchSet: 2
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jasper van der Neut <jasper at isotopic.nl>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200930/60f4a7cd/attachment-0001.html>
More information about the asterisk-code-review
mailing list