[asterisk-commits] app directory: Handle a NULL mailbox without crashing (asterisk[13])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Sep 5 08:20:26 CDT 2017
Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/6370 )
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, 6 insertions(+), 1 deletion(-)
Approvals:
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
George Joseph: Looks good to me, approved
diff --git a/apps/app_directory.c b/apps/app_directory.c
index b75e857..9cfcbf8 100644
--- a/apps/app_directory.c
+++ b/apps/app_directory.c
@@ -511,6 +511,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_debug(3, "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)) {
@@ -531,7 +536,7 @@
/* Does the context exist within the config file? If not, make one */
if (!(cat = ast_category_get(cfg, ctx, NULL))) {
- if (!(cat = ast_category_new(ctx, "", 99999))) {
+ if (!(cat = ast_category_new_dynamic(ctx))) {
ast_log(LOG_WARNING, "Out of memory\n");
ast_config_destroy(cfg);
if (rtdata) {
--
To view, visit https://gerrit.asterisk.org/6370
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibbbca85517b04c315406ebfe3b6f7e0763daedc6
Gerrit-Change-Number: 6370
Gerrit-PatchSet: 3
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-commits/attachments/20170905/817aea7a/attachment-0001.html>
More information about the asterisk-commits
mailing list