diff options
author | Marc Laukien <marc@zeroc.com> | 2004-01-26 23:10:40 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-01-26 23:10:40 +0000 |
commit | 921c8801fac45df8082d7c4621ca813199cbc150 (patch) | |
tree | 3b136b405318eb89de07022226a6233dc6070268 /cpp/src/Ice/BasicStream.cpp | |
parent | <iterate> fix (diff) | |
download | ice-921c8801fac45df8082d7c4621ca813199cbc150.tar.bz2 ice-921c8801fac45df8082d7c4621ca813199cbc150.tar.xz ice-921c8801fac45df8082d7c4621ca813199cbc150.zip |
fix
Diffstat (limited to 'cpp/src/Ice/BasicStream.cpp')
-rw-r--r-- | cpp/src/Ice/BasicStream.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index 6b758cb631e..0987c83efbe 100644 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -1106,12 +1106,16 @@ IceInternal::BasicStream::read(vector<string>& v) Int sz; readSize(sz); v.clear(); - v.reserve(sz); + + // + // Don't use v.resize(sz) or v.reserve(sz) here, as it cannot be + // checked whether sz is a reasonable value. + // + while(sz--) { - string s; - read(s); - v.push_back(s); + v.resize(v.size() + 1); + read(v.back()); } } |