summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-12-14 08:04:51 -0600
committerChad Elliott <elliottc@objectcomputing.com>2022-12-14 08:04:51 -0600
commit5e0418d120dbff81325bd20bb575c09e550023a5 (patch)
tree3265384d5cacef2da3639c5965d422dd9152d7f3 /TAO
parent8038e3e754d1307c2d465f3029909fd4f7b27a1b (diff)
downloadATCD-5e0418d120dbff81325bd20bb575c09e550023a5.tar.gz
Pulled in changes from ACE 7.
Diffstat (limited to 'TAO')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp b/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
index 638cce03153..0dc5927131b 100644
--- a/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_native/native_ch.cpp
@@ -68,15 +68,16 @@ be_visitor_native_ch::visit_native (be_native *node)
// strip the "Seq" ending to get the sample's name
const char * node_name = node->full_name ();
const size_t max_name_length = 2000;
- if (ACE_OS::strlen (node_name) >= max_name_length)
+ const size_t node_name_length = ACE_OS::strlen (node_name);
+ if (node_name_length >= max_name_length ||
+ node_name_length <= 3)
{
return -1;
}
char sample_name[max_name_length];
- ACE_OS::strncpy (sample_name,
- node_name,
- ACE_OS::strlen (node_name) - 3);
- sample_name[ACE_OS::strlen (node_name) - 3] = '\0';
+ // Copy node_name into sample_name and shorten to remove Seq suffix
+ ACE_OS::strcpy (sample_name, node_name);
+ sample_name[node_name_length - 3] = '\0';
*os << be_nl_2
<< "typedef ::TAO::DCPS::ZeroCopyDataSeq< "