[asterisk-commits] branch 1.2 r30770 -
/branches/1.2/apps/app_queue.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue May 30 07:55:18 MST 2006
Author: bweschke
Date: Tue May 30 09:55:16 2006
New Revision: 30770
URL: http://svn.digium.com/view/asterisk?rev=30770&view=rev
Log:
Fix infinite loop scenario and add some sanity checking to prevent segfault on a NULL parameter coming in (which probably shouldn't happen, but just to be safe...)
Modified:
branches/1.2/apps/app_queue.c
Modified: branches/1.2/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_queue.c?rev=30770&r1=30769&r2=30770&view=diff
==============================================================================
--- branches/1.2/apps/app_queue.c (original)
+++ branches/1.2/apps/app_queue.c Tue May 30 09:55:16 2006
@@ -622,6 +622,9 @@
{
struct ast_member_interfaces *curint, *newint;
+ if (!interface)
+ return 0;
+
AST_LIST_LOCK(&interfaces);
AST_LIST_TRAVERSE(&interfaces, curint, list) {
if (!strcasecmp(curint->interface, interface))
@@ -648,6 +651,9 @@
struct ast_call_queue *q;
struct member *mem;
int ret = 0;
+
+ if (!interface)
+ return ret;
ast_mutex_lock(&qlock);
for (q = queues; q && !ret; q = q->next) {
@@ -658,6 +664,7 @@
ret = 1;
break;
}
+ mem = mem->next;
}
ast_mutex_unlock(&q->lock);
}
@@ -670,6 +677,9 @@
static int remove_from_interfaces(char *interface)
{
struct ast_member_interfaces *curint;
+
+ if (!interface)
+ return 0;
AST_LIST_LOCK(&interfaces);
AST_LIST_TRAVERSE_SAFE_BEGIN(&interfaces, curint, list) {
More information about the asterisk-commits
mailing list