From 7e95997eab01e00a165b7b2bb218504c693da725 Mon Sep 17 00:00:00 2001 From: Mark Spruiell Date: Mon, 9 Feb 2009 15:19:01 -0800 Subject: bug 3576 - stream operations should raise exceptions instead of crash --- cpp/src/Ice/StreamI.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cpp/src/Ice/StreamI.cpp') diff --git a/cpp/src/Ice/StreamI.cpp b/cpp/src/Ice/StreamI.cpp index f992b99b76f..c0006b817c0 100644 --- a/cpp/src/Ice/StreamI.cpp +++ b/cpp/src/Ice/StreamI.cpp @@ -9,6 +9,7 @@ #include #include +#include using namespace std; using namespace Ice; @@ -305,7 +306,7 @@ Ice::InputStreamI::startEncapsulation() void Ice::InputStreamI::endEncapsulation() { - _is->endReadEncaps(); + _is->endReadEncapsChecked(); } void @@ -562,6 +563,11 @@ Ice::OutputStreamI::writeWstringSeq(const vector& v) void Ice::OutputStreamI::writeSize(Int sz) { + if(sz < 0) + { + throw NegativeSizeException(__FILE__, __LINE__); + } + _os->writeSize(sz); } @@ -610,7 +616,7 @@ Ice::OutputStreamI::startEncapsulation() void Ice::OutputStreamI::endEncapsulation() { - _os->endWriteEncaps(); + _os->endWriteEncapsChecked(); } void -- cgit v1.2.3