<p>George Joseph <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15005">View Change</a></p><div style="white-space:pre-wrap">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
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">channels: Don't dereference NULL pointer<br><br>Check result of ast_translator_build_path against NULL before dereferencing.<br><br>ASTERISK-29091<br><br>Change-Id: Ia3538ea190bd371f70c9dd49984b021765691b29<br>---<br>M main/channel.c<br>1 file changed, 6 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/channel.c b/main/channel.c</span><br><span>index 0470ddc..f873807 100644</span><br><span>--- a/main/channel.c</span><br><span>+++ b/main/channel.c</span><br><span>@@ -5686,11 +5686,15 @@</span><br><span> if (!direction) {</span><br><span> /* reading */</span><br><span> trans_pvt = ast_translator_build_path(best_set_fmt, best_native_fmt);</span><br><span style="color: hsl(0, 100%, 40%);">- trans_pvt->interleaved_stereo = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (trans_pvt) {</span><br><span style="color: hsl(120, 100%, 40%);">+ trans_pvt->interleaved_stereo = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> } else {</span><br><span> /* writing */</span><br><span> trans_pvt = ast_translator_build_path(best_native_fmt, best_set_fmt);</span><br><span style="color: hsl(0, 100%, 40%);">- trans_pvt->interleaved_stereo = interleaved_stereo;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (trans_pvt) {</span><br><span style="color: hsl(120, 100%, 40%);">+ trans_pvt->interleaved_stereo = interleaved_stereo;</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> access->set_trans(chan, trans_pvt);</span><br><span> res = trans_pvt ? 0 : -1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15005">change 15005</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15005"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: Ia3538ea190bd371f70c9dd49984b021765691b29 </div>
<div style="display:none"> Gerrit-Change-Number: 15005 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jasper van der Neut <jasper@isotopic.nl> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>