From a56da797d96bb797825b8c5029f597e1472050cc Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 17 Aug 2015 13:34:15 -0500 Subject: [PATCH] app_queue.c: Fix error checking in QUEUE_MEMBER() read. Change-Id: I7294e13d27875851c2f4ef6818adba507509d224 --- apps/app_queue.c | 69 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 23 deletions(-) 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(,