[Asterisk-code-review] app directory: Handle a NULL mailbox without crashing (asterisk[15])
Sean Bright
asteriskteam at digium.com
Fri Sep 1 09:54:40 CDT 2017
Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/6372
Change subject: app_directory: Handle a NULL mailbox without crashing
......................................................................
app_directory: Handle a NULL mailbox without crashing
ASTERISK-27241 #close
Reported by: David Moore
Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6
---
M apps/app_directory.c
1 file changed, 5 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/72/6372/1
diff --git a/apps/app_directory.c b/apps/app_directory.c
index dd80c34..039eeed 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -509,6 +509,11 @@
const char *mailbox = ast_variable_retrieve(rtdata, category, "mailbox");
const char *ctx = ast_variable_retrieve(rtdata, category, "context");
+ if (ast_strlen_zero(mailbox)) {
+ ast_log(LOG_WARNING, "Skipping result with missing or empty mailbox\n");
+ continue;
+ }
+
fullname = ast_variable_retrieve(rtdata, category, "fullname");
hidefromdir = ast_variable_retrieve(rtdata, category, "hidefromdir");
if (ast_true(hidefromdir)) {
--
To view, visit https://gerrit.asterisk.org/6372
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6
Gerrit-Change-Number: 6372
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20170901/5b8d6702/attachment-0001.html>
More information about the asterisk-code-review
mailing list