app_queue: Handle empty 'interface' in queue member config
authorSean Bright <sean.bright@gmail.com>
Mon, 4 Mar 2019 22:05:30 +0000 (17:05 -0500)
committerSean Bright <sean.bright@gmail.com>
Mon, 4 Mar 2019 22:07:46 +0000 (16:07 -0600)
While the 'interface' column is a NOT NULL, the empty string is still
allowed. res_config_odbc treats the empty string as a NULL and we crash
when trying to dereference.

Also cleaned up an adjacent error message for consistency.

ASTERISK-28168 #close

Change-Id: I55e012b540fbcda99bb40bede3099b7ae5db8202

apps/app_queue.c

index 8b34d73..10dd06a 100644 (file)
@@ -3410,7 +3410,14 @@ static void rt_handle_member_record(struct call_queue *q, char *category, struct
        const char *wrapuptime_str = ast_variable_retrieve(member_config, category, "wrapuptime");
 
        if (ast_strlen_zero(rt_uniqueid)) {
-               ast_log(LOG_WARNING, "Realtime field uniqueid is empty for member %s\n", S_OR(membername, "NULL"));
+               ast_log(LOG_WARNING, "Realtime field 'uniqueid' is empty for member %s\n",
+                       S_OR(membername, "NULL"));
+               return;
+       }
+
+       if (ast_strlen_zero(interface)) {
+               ast_log(LOG_WARNING, "Realtime field 'interface' is empty for member %s\n",
+                       S_OR(membername, "NULL"));
                return;
        }