summaryrefslogtreecommitdiff
path: root/datatest.cpp
diff options
context:
space:
mode:
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')