From: Richard Mudgett Date: Mon, 17 Aug 2015 18:34:15 +0000 (-0500) Subject: app_queue.c: Fix error checking in QUEUE_MEMBER() read. X-Git-Tag: 11.20.0-rc1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F1103%2F2;p=thirdparty%2Fasterisk.git app_queue.c: Fix error checking in QUEUE_MEMBER() read. Change-Id: I7294e13d27875851c2f4ef6818adba507509d224 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index 3c6d9e0417..bdbbc0ab43 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -7395,12 +7395,29 @@ static int queue_function_exists(struct ast_channel *chan, const char *cmd, char return 0; } +static struct member *get_interface_helper(struct call_queue *q, const char *interface) +{ + struct member *m; + + if (ast_strlen_zero(interface)) { + ast_log(LOG_ERROR, "QUEUE_MEMBER: Missing required interface argument.\n"); + return NULL; + } + + m = interface_exists(q, interface); + if (!m) { + ast_log(LOG_ERROR, "Queue member interface '%s' not in queue '%s'.\n", + interface, q->name); + } + return m; +} + /*! * \brief Get number either busy / free / ready or total members of a specific queue * \brief Get or set member properties penalty / paused / ringinuse * \retval number of members (busy / free / ready / total) or member info (penalty / paused / ringinuse) * \retval -1 on error -*/ + */ static int queue_function_mem_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len) { int count = 0; @@ -7417,14 +7434,18 @@ static int queue_function_mem_read(struct ast_channel *chan, const char *cmd, ch buf[0] = '\0'; if (ast_strlen_zero(data)) { - ast_log(LOG_ERROR, "Missing required argument. %s(,