<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/12739">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Benjamin Keith Ford: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_voicemail/IMAP: check mailstream not NULL in leave_voicemail<br><br>The function leave_voicemail checks if expungeonhangup is set,<br>but does not check if IMAP stream is closed,<br>so it could call imap function with NULL stream.<br>This leads to segfault.<br><br>ASTERISK-28505 #close<br><br>Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c<br>---<br>M apps/app_voicemail.c<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c</span><br><span>index c0edd44..a7cf8de 100644</span><br><span>--- a/apps/app_voicemail.c</span><br><span>+++ b/apps/app_voicemail.c</span><br><span>@@ -7247,7 +7247,7 @@</span><br><span> #ifdef IMAP_STORAGE</span><br><span>        /* expunge message - use UID Expunge if supported on IMAP server*/</span><br><span>   ast_debug(3, "*** Checking if we can expunge, expungeonhangup set to %d\n", expungeonhangup);</span><br><span style="color: hsl(0, 100%, 40%);">- if (expungeonhangup == 1) {</span><br><span style="color: hsl(120, 100%, 40%);">+   if (expungeonhangup == 1 && vms->mailstream != NULL) {</span><br><span>            ast_mutex_lock(&vms->lock);</span><br><span> #ifdef HAVE_IMAP_TK2006</span><br><span>                if (LEVELUIDPLUS (vms->mailstream)) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/12739">change 12739</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/+/12739"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ib66c57c1f1ba97774e447b36349198e2626a8d7c </div>
<div style="display:none"> Gerrit-Change-Number: 12739 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.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: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>