You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2016/11/03 19:59:03 UTC

[2/3] qpid-dispatch git commit: DISPATCH-558 - Removed assertions in core agent that can fail with malformed queries.

DISPATCH-558 - Removed assertions in core agent that can fail with malformed queries.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/ff07004d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/ff07004d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/ff07004d

Branch: refs/heads/master
Commit: ff07004d960a6ebbb4f9d1ec9606a93cac372c5e
Parents: bbcfea0
Author: Ted Ross <tr...@redhat.com>
Authored: Thu Nov 3 15:46:48 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Thu Nov 3 15:46:48 2016 -0400

----------------------------------------------------------------------
 src/router_core/agent.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/ff07004d/src/router_core/agent.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent.c b/src/router_core/agent.c
index 16dd30b..5b46e01 100644
--- a/src/router_core/agent.c
+++ b/src/router_core/agent.c
@@ -245,8 +245,8 @@ static void qdr_agent_emit_columns(qdr_query_t *query, const char *qdr_columns[]
     qd_compose_start_list(query->body);
     int i = 0;
     while (query->columns[i] >= 0) {
-        assert(query->columns[i] < column_count);
-        qd_compose_insert_string(query->body, qdr_columns[query->columns[i]]);
+        if (query->columns[i] < column_count)
+            qd_compose_insert_string(query->body, qdr_columns[query->columns[i]]);
         i++;
     }
     qd_compose_end_list(query->body);
@@ -266,11 +266,12 @@ static void qdr_agent_set_columns(qdr_query_t *query,
         // Either the attribute_names field is absent, it's not a list, or it's an empty list.
         // In this case, we will include all available attributes.
         //
+        if (column_count > QDR_AGENT_MAX_COLUMNS)
+            column_count = QDR_AGENT_MAX_COLUMNS;
         int i;
         for (i = 0; i < column_count; i++)
             query->columns[i] = i;
         query->columns[i] = -1;
-        assert(i < QDR_AGENT_MAX_COLUMNS);
         return;
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org