From 5cf98e24598376c69ed1da42c5704b9ab1539ee8 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 17 Aug 2015 13:34:15 -0500 Subject: 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(-) (limited to 'apps') diff --git a/apps/app_queue.c b/apps/app_queue.c index d04080c27..69cd79002 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -8019,12 +8019,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; @@ -8041,14 +8058,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(,