You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2015/06/18 22:15:39 UTC

[34/50] [abbrv] qpid-proton git commit: PROTON-917: avoid buffer underrun if no mechs given

PROTON-917: avoid buffer underrun if no mechs given


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

Branch: refs/heads/kgiusti-python3
Commit: 718d8b37644ab9102364ce8e23ee47b029191556
Parents: cbb6800
Author: Ken Giusti <kg...@apache.org>
Authored: Wed Jun 17 14:47:29 2015 -0400
Committer: Ken Giusti <kg...@apache.org>
Committed: Wed Jun 17 14:49:58 2015 -0400

----------------------------------------------------------------------
 proton-c/src/sasl/sasl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/718d8b37/proton-c/src/sasl/sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c
index 3142832..c339ea9 100644
--- a/proton-c/src/sasl/sasl.c
+++ b/proton-c/src/sasl/sasl.c
@@ -586,7 +586,10 @@ int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t cha
       pn_string_addf(mechs, "%*s ", (int)s.size, s.start);
     }
   }
-  pn_string_buffer(mechs)[pn_string_size(mechs)-1] = 0;
+
+  if (pn_string_size(mechs)) {
+      pn_string_buffer(mechs)[pn_string_size(mechs)-1] = 0;
+  }
 
   if (pni_init_client(transport) &&
       pni_process_mechanisms(transport, pn_string_get(mechs))) {


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