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/04/06 17:03:50 UTC

qpid-dispatch git commit: DISPATCH-245 - More fixes of bugs reported by Coverity.

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 15de0870d -> 4f65d46d3


DISPATCH-245 - More fixes of bugs reported by Coverity.


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

Branch: refs/heads/master
Commit: 4f65d46d378846e8cbb389454f20d651281d52c2
Parents: 15de087
Author: Ted Ross <tr...@redhat.com>
Authored: Wed Apr 6 11:03:18 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Wed Apr 6 11:03:18 2016 -0400

----------------------------------------------------------------------
 src/router_core/forwarder.c | 2 +-
 src/router_node.c           | 5 ++---
 src/server.c                | 4 ++--
 3 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4f65d46d/src/router_core/forwarder.c
----------------------------------------------------------------------
diff --git a/src/router_core/forwarder.c b/src/router_core/forwarder.c
index 1a03f93..58501fd 100644
--- a/src/router_core/forwarder.c
+++ b/src/router_core/forwarder.c
@@ -504,7 +504,7 @@ bool qdr_forward_link_balanced_CT(qdr_core_t     *core,
         out_link->admin_enabled  = true;
         out_link->oper_status    = QDR_LINK_OPER_DOWN;
 
-        out_link->name = (char*) malloc(strlen(in_link->name + 1));
+        out_link->name = (char*) malloc(strlen(in_link->name) + 1);
         strcpy(out_link->name, in_link->name);
 
         out_link->connected_link = in_link;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4f65d46d/src/router_node.c
----------------------------------------------------------------------
diff --git a/src/router_node.c b/src/router_node.c
index 530ca9f..38c9027 100644
--- a/src/router_node.c
+++ b/src/router_node.c
@@ -53,8 +53,7 @@ static void qd_router_connection_get_config(const qd_connection_t  *conn,
 
         *strip_annotations_in  = cf ? cf->strip_inbound_annotations  : false;
         *strip_annotations_out = cf ? cf->strip_outbound_annotations : false;
-
-        *link_capacity = cf->link_capacity;
+        *link_capacity         = cf ? cf->link_capacity : 1;
 
         if        (cf && strcmp(cf->role, router_role) == 0) {
             *strip_annotations_in  = false;
@@ -66,7 +65,7 @@ static void qd_router_connection_get_config(const qd_connection_t  *conn,
         else
             *role = QDR_ROLE_NORMAL;
 
-        *name = cf->name;
+        *name = cf ? cf->name : 0;
         if (*name) {
             if (strncmp("listener/", *name, 9) == 0 ||
                 strncmp("connector/", *name, 10) == 0)

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/4f65d46d/src/server.c
----------------------------------------------------------------------
diff --git a/src/server.c b/src/server.c
index 9cd945c..1f3add2 100644
--- a/src/server.c
+++ b/src/server.c
@@ -144,10 +144,10 @@ static const char *qd_transport_get_user(qd_connection_t *conn, pn_transport_t *
         // The tokens in the uidFormat strings are delimited by comma. Load the individual components of the uidFormat
         // into the components[] array. The maximum number of components that are allowed are 7 namely, c, s, l, o, u, n, (1 or 2 or 5)
         //
-        char components[7];
+        char components[8];
 
         //The strcpy() function copies the string pointed to by src, including the terminating null byte ('\0'), to the buffer pointed to by dest.
-        strcpy(components, config->ssl_uid_format);
+        strncpy(components, config->ssl_uid_format, 7);
 
         const char *country_code = 0;
         const char *state = 0;


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