diff options
author | Mark Spruiell <mes@zeroc.com> | 2009-02-09 15:19:01 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2009-02-09 15:19:01 -0800 |
commit | 7e95997eab01e00a165b7b2bb218504c693da725 (patch) | |
tree | c70c767ba9fad26fcf6de3dd5ac19917d5c641ee /cpp/src/Ice/StreamI.cpp | |
parent | Add other official patchs in REAME (diff) | |
download | ice-7e95997eab01e00a165b7b2bb218504c693da725.tar.bz2 ice-7e95997eab01e00a165b7b2bb218504c693da725.tar.xz ice-7e95997eab01e00a165b7b2bb218504c693da725.zip |
bug 3576 - stream operations should raise exceptions instead of crash
Diffstat (limited to 'cpp/src/Ice/StreamI.cpp')
-rw-r--r-- | cpp/src/Ice/StreamI.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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 <Ice/StreamI.h> #include <Ice/Initialize.h> +#include <Ice/LocalException.h> 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<wstring>& 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 |