<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6373">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
George Joseph: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_directory: Handle a NULL mailbox without crashing<br><br>ASTERISK-27241 #close<br>Reported by: David Moore<br><br>Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6<br>---<br>M apps/app_directory.c<br>1 file changed, 6 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/apps/app_directory.c b/apps/app_directory.c<br>index dd80c34..6866aa3 100644<br>--- a/apps/app_directory.c<br>+++ b/apps/app_directory.c<br>@@ -509,6 +509,11 @@<br> const char *mailbox = ast_variable_retrieve(rtdata, category, "mailbox");<br> const char *ctx = ast_variable_retrieve(rtdata, category, "context");<br> <br>+ if (ast_strlen_zero(mailbox)) {<br>+ ast_debug(3, "Skipping result with missing or empty mailbox\n");<br>+ continue;<br>+ }<br>+<br> fullname = ast_variable_retrieve(rtdata, category, "fullname");<br> hidefromdir = ast_variable_retrieve(rtdata, category, "hidefromdir");<br> if (ast_true(hidefromdir)) {<br>@@ -529,7 +534,7 @@<br> <br> /* Does the context exist within the config file? If not, make one */<br> if (!(cat = ast_category_get(cfg, ctx, NULL))) {<br>- if (!(cat = ast_category_new(ctx, "", 99999))) {<br>+ if (!(cat = ast_category_new_dynamic(ctx))) {<br> ast_log(LOG_WARNING, "Out of memory\n");<br> ast_config_destroy(cfg);<br> if (rtdata) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6373">change 6373</a>. To unsubscribe, 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/6373"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6 </div>
<div style="display:none"> Gerrit-Change-Number: 6373 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>