summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-06-18 20:08:16 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2009-06-18 20:08:16 +0000
commit0185d170d45fcf847c85148ecb2d8d1ca3f36e2b (patch)
treee3e9aa57bbb5ff47febd09371432d43b6c328fce /datatest.cpp
parent625e5a8083971aa8dad2a57b60591234b8615ea7 (diff)
downloadcryptopp-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.cpp4
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')