You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2018/02/26 20:11:12 UTC

[2/2] qpid-proton git commit: NO-JIRA: [c] minor fix for sanitizer warning

NO-JIRA: [c] minor fix for sanitizer warning


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

Branch: refs/heads/master
Commit: 96c72404ae2dff977f58dfb54747ff8c20723843
Parents: 81ddadc
Author: Alan Conway <ac...@redhat.com>
Authored: Fri Feb 23 09:25:33 2018 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Mon Feb 26 15:10:40 2018 -0500

----------------------------------------------------------------------
 proton-c/src/core/transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/96c72404/proton-c/src/core/transport.c
----------------------------------------------------------------------
diff --git a/proton-c/src/core/transport.c b/proton-c/src/core/transport.c
index 86d0c2a..c49ddd4 100644
--- a/proton-c/src/core/transport.c
+++ b/proton-c/src/core/transport.c
@@ -1349,7 +1349,7 @@ int pn_do_attach(pn_transport_t *transport, uint8_t frame_type, uint16_t channel
   char strbuf[128];      // avoid malloc for most link names
   char *strheap = (name.size >= sizeof(strbuf)) ? (char *) malloc(name.size + 1) : NULL;
   char *strname = strheap ? strheap : strbuf;
-  strncpy(strname, name.start, name.size);
+  if (name.size > 0) strncpy(strname, name.start, name.size);
   strname[name.size] = '\0';
 
   pn_session_t *ssn = pni_channel_state(transport, channel);


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