From: phoneben <67923255+phoneben@users.noreply.github.com> Date: Thu, 11 Sep 2025 17:31:30 +0000 (+0300) Subject: app_queue: Add NULL pointer checks in app_queue X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af673211346c36d0435a8b2e2af69f6affd8b0f8;p=thirdparty%2Fasterisk.git app_queue: Add NULL pointer checks in app_queue Add NULL check for word_list before calling word_in_list() Add NULL checks for channel snapshots from ast_multi_channel_blob_get_channel() Resolves: #1425 --- diff --git a/apps/app_queue.c b/apps/app_queue.c index 1f5d153a23..a3aff975a1 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -6701,7 +6701,15 @@ static void handle_local_optimization_begin(void *userdata, struct stasis_subscr struct local_optimization *optimization; unsigned int id; SCOPED_AO2LOCK(lock, queue_data); - + + if (!local_one || !local_two || !source) { + ast_debug(1, "Local optimization begin missing channel snapshots:%s%s%s\n", + !local_one ? " local_one," : "", + !local_two ? " local_two," : "", + !source ? " source," : ""); + return; + } + if (queue_data->dying) { return; } @@ -10500,7 +10508,7 @@ static char *complete_queue(const char *line, const char *word, int pos, int sta queue_iter = ao2_iterator_init(queues, 0); while ((q = ao2_t_iterator_next(&queue_iter, "Iterate through queues"))) { if (!strncasecmp(word, q->name, wordlen) && ++which > state - && (!word_list_offset || !word_in_list(word_list, q->name))) { + && (!word_list_offset || !word_list || !word_in_list(word_list, q->name))) { ret = ast_strdup(q->name); queue_t_unref(q, "Done with iterator"); break;