summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
diff options
context:
space:
mode:
authorAdam Mitz <mitza@objectcomputing.com>2022-03-11 10:35:21 -0600
committerAdam Mitz <mitza@objectcomputing.com>2022-03-11 10:35:21 -0600
commit0bfdaeb95608f3652cfe499e1960988c71476f30 (patch)
tree64ab798df0bc59d4f08010743eefc65dd5c52919 /TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
parent0e83442609e0645fbc41f34db269842b462e8f44 (diff)
downloadATCD-0bfdaeb95608f3652cfe499e1960988c71476f30.tar.gz
tao_idl: avoid undefined behavior (adding to nullptr)
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
index 041af2c2dc1..80569862e4b 100644
--- a/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_operation/upcall_command_ss.cpp
@@ -220,9 +220,8 @@ be_visitor_operation_upcall_command_ss::gen_upcall (
const char *op_name = node->flat_name ();
static const char *excep_suffix = "_excep";
static const size_t excep_suffix_len = ACE_OS::strlen (excep_suffix);
- bool excep_method = ((ACE_OS::strstr (op_name, excep_suffix) +
- excep_suffix_len) ==
- (op_name + ACE_OS::strlen (op_name)));
+ const char *substr = ACE_OS::strstr (op_name, excep_suffix);
+ bool excep_method = substr && substr + excep_suffix_len == op_name + ACE_OS::strlen (op_name);
for (; !si.is_done (); si.next (), ++index)
{