<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15660">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue.c: Don't crash when realtime queue name is empty.<br><br>ASTERISK-27542 #close<br><br>Change-Id: If0b9719380a25533d2aed1053cff845dc3a4854a<br>---<br>M apps/app_queue.c<br>1 file changed, 8 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/60/15660/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index eddf5c7..d4adb6f 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -7697,6 +7697,10 @@</span><br><span>                            char *category = NULL;</span><br><span>                               while ((category = ast_category_browse(queue_config, category))) {</span><br><span>                                   const char *name = ast_variable_retrieve(queue_config, category, "name");</span><br><span style="color: hsl(120, 100%, 40%);">+                                   if (ast_strlen_zero(name)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                          ast_log(LOG_WARNING, "Ignoring realtime queue with a NULL or empty 'name.'\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                                             continue;</span><br><span style="color: hsl(120, 100%, 40%);">+                                     }</span><br><span>                                    if ((q = find_load_queue_rt_friendly(name))) {</span><br><span>                                               foundqueue++;</span><br><span>                                                foundinterface += set_member_value_help_members(q, interface, property, value);</span><br><span>@@ -9793,6 +9797,10 @@</span><br><span>                     char *category = NULL;</span><br><span>                       while ((category = ast_category_browse(cfg, category))) {</span><br><span>                            const char *queuename = ast_variable_retrieve(cfg, category, "name");</span><br><span style="color: hsl(120, 100%, 40%);">+                               if (ast_strlen_zero(queuename)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                                     ast_log(LOG_WARNING, "Ignoring realtime queue with a NULL or empty 'name.'\n");</span><br><span style="color: hsl(120, 100%, 40%);">+                                     continue;</span><br><span style="color: hsl(120, 100%, 40%);">+                             }</span><br><span>                            if ((q = find_load_queue_rt_friendly(queuename))) {</span><br><span>                                  queue_t_unref(q, "Done with temporary pointer");</span><br><span>                           }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15660">change 15660</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/+/15660"/><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-Change-Id: If0b9719380a25533d2aed1053cff845dc3a4854a </div>
<div style="display:none"> Gerrit-Change-Number: 15660 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>