Repository: qpid-proton
Updated Branches:
  refs/heads/aconway-proton-1125 [created] 35952a065


PROTON-1125: c++: Fix core dump on empty address in link_options, discovered by 
coverity.


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

Branch: refs/heads/aconway-proton-1125
Commit: 35952a065d9023e0327c2bb62ca37134f47a6626
Parents: 5917bf8
Author: Alan Conway <[email protected]>
Authored: Tue Feb 2 21:17:34 2016 -0500
Committer: Alan Conway <[email protected]>
Committed: Tue Feb 2 21:17:34 2016 -0500

----------------------------------------------------------------------
 proton-c/bindings/cpp/src/link_options.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/35952a06/proton-c/bindings/cpp/src/link_options.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/link_options.cpp 
b/proton-c/bindings/cpp/src/link_options.cpp
index 7364c59..3fc694b 100644
--- a/proton-c/bindings/cpp/src/link_options.cpp
+++ b/proton-c/bindings/cpp/src/link_options.cpp
@@ -74,11 +74,10 @@ class link_options::impl {
         if (l.state() & endpoint::LOCAL_UNINIT) {
             bool sender = !l.receiver();
             if (local_address.set) {
-                const char *addr = local_address.value.empty() ? NULL : 
local_address.value.c_str();
                 if (sender)
-                    l.local_target().address(addr);
+                    l.local_target().address(local_address.value);
                 else
-                    l.local_source().address(addr);
+                    l.local_source().address(local_address.value);
             }
             if (delivery_mode.set) {
                 switch (delivery_mode.value) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to