summaryrefslogtreecommitdiff
path: root/TAO/TAO_IDL/be/be_visitor_sequence
diff options
context:
space:
mode:
authorjoeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-23 16:50:53 +0000
committerjoeh <joeh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-04-23 16:50:53 +0000
commita349b65c27c1845abe47a10a35166372d219e4cb (patch)
tree268c4a012e314f3e8f7d7683f462707c4d22face /TAO/TAO_IDL/be/be_visitor_sequence
parent187d7d63be2f24d94b52a0b2fbf73611db7ef8bc (diff)
downloadATCD-a349b65c27c1845abe47a10a35166372d219e4cb.tar.gz
Mon Apr 23 11:49:01 2001 Joe Hoffert <joeh@cs.wustl.edu>
Diffstat (limited to 'TAO/TAO_IDL/be/be_visitor_sequence')
-rw-r--r--TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
index a2647093471..0b9f85f7f49 100644
--- a/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
+++ b/TAO/TAO_IDL/be/be_visitor_sequence/cdr_op_cs.cpp
@@ -191,6 +191,14 @@ be_visitor_sequence_cdr_op_cs::visit_sequence (be_sequence *node)
*os << "// If length is 0 we return true." << be_nl;
*os << "if (0 >= _tao_seq_len) " << be_idt_nl;
*os << "return 1;" << be_uidt_nl;
+
+ // Add a sanity check for the length of a sequence.
+ *os << "// Add a check to the length of the sequence" << be_nl;
+ *os << "// to make sure it does not exceed the length" << be_nl;
+ *os << "// of the stream. (See bug 58.)" << be_nl;
+ *os << "if (_tao_seq_len > strm.length())" << be_idt_nl;
+ *os << "return 0;" << be_uidt_nl;
+
*os << "// retrieve all the elements" << be_nl;