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 2018/11/01 16:33:57 UTC

qpid-dispatch git commit: DISPATCH-1163 : disallow array overrun if links exceed max priority. This closes #413

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 6cf2f20ab -> 0af3cd861


DISPATCH-1163 : disallow array overrun if links exceed max priority.
This closes #413


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

Branch: refs/heads/master
Commit: 0af3cd861ae76fc716a49d2df030b0279d23ac53
Parents: 6cf2f20
Author: Michael Goulish <mg...@redhat.com>
Authored: Thu Nov 1 05:11:35 2018 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Thu Nov 1 12:27:55 2018 -0400

----------------------------------------------------------------------
 src/router_core/connections.c | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/0af3cd86/src/router_core/connections.c
----------------------------------------------------------------------
diff --git a/src/router_core/connections.c b/src/router_core/connections.c
index ef2e236..df8cc60 100644
--- a/src/router_core/connections.c
+++ b/src/router_core/connections.c
@@ -1471,7 +1471,12 @@ static void qdr_attach_link_data_CT(qdr_core_t *core, qdr_connection_t *conn, qd
         // are assigned priorities in the order in which they are attached.
         int next_slot = core->data_links_by_mask_bit[conn->mask_bit].count ++;
         if (next_slot > QDR_MAX_PRIORITY) {
+            // If somebody tries to exceed max links, log an error and
+            // do not allow replacement of the legitimate link that is already in the max slot.
+            // This is not serious enough to cause a program exit, but if it ever
+            // happens it should be investiagted as a bug.
             qd_log(core->log, QD_LOG_ERROR, "Attempt to attach too many inter-router links for priority sheaf.");
+            return;
         }
         link->priority = next_slot;
         core->data_links_by_mask_bit[conn->mask_bit].links[next_slot] = link;


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