diff options
author | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2009-06-18 20:08:16 +0000 |
---|---|---|
committer | weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2009-06-18 20:08:16 +0000 |
commit | 0185d170d45fcf847c85148ecb2d8d1ca3f36e2b (patch) | |
tree | e3e9aa57bbb5ff47febd09371432d43b6c328fce /datatest.cpp | |
parent | 625e5a8083971aa8dad2a57b60591234b8615ea7 (diff) | |
download | cryptopp-0185d170d45fcf847c85148ecb2d8d1ca3f36e2b.tar.gz |
fix bug in PutDecodedDatumInto() with STLPort (from trungantran)
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@469 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'datatest.cpp')
-rw-r--r-- | datatest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/datatest.cpp b/datatest.cpp index 04b4e72..b7b73da 100644 --- a/datatest.cpp +++ b/datatest.cpp @@ -64,7 +64,11 @@ void PutDecodedDatumInto(const TestData &data, const char *name, BufferedTransfo while (!s1.empty()) { while (s1[0] == ' ') + { s1 = s1.substr(1); + if (s1.empty()) + return; //avoid invalid read if s1 is empty + } int repeat = 1; if (s1[0] == 'r') |