From: Tilghman Lesher Date: Sun, 1 Feb 2009 02:44:23 +0000 (+0000) Subject: Blank argument crashes Asterisk X-Git-Tag: 1.6.2.0-beta1~318 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=317e4e7313ed2aeeb441adf9310c1e9cf517f93d;p=thirdparty%2Fasterisk.git Blank argument crashes Asterisk (closes issue #14377) Reported by: amorsen git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172741 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index bb1366bad1..61a1521a2f 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -9627,6 +9627,11 @@ static int acf_mailbox_exists(struct ast_channel *chan, const char *cmd, char *a AST_NONSTANDARD_APP_ARGS(arg, args, '@'); + if (ast_strlen_zero(arg.mbox)) { + ast_log(LOG_ERROR, "MAILBOX_EXISTS requires an argument ([@])\n"); + return -1; + } + ast_copy_string(buf, find_user(&svm, ast_strlen_zero(arg.context) ? "default" : arg.context, arg.mbox) ? "1" : "0", len); return 0; }