Skip to content

Commit b051038

Browse files
committed
maxBlanksCount -> maxBlankCount, change log added
1 parent 1b91a0e commit b051038

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

testlib.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* Copyright (c) 2005-2025
2626
*/
2727

28-
#define VERSION "0.9.45"
28+
#define VERSION "0.9.45-SNAPSHOT"
2929

3030
/*
3131
* Mike Mirzayanov
@@ -63,6 +63,7 @@
6363
*/
6464

6565
const char *latestFeatures[] = {
66+
"Added maxBlankCount to InStream to avoid infinite loops in skipBlanks()",
6667
"Remove incorrect const attributes",
6768
"Added ConstantBoundsLog, VariablesLog to validator testOverviewLogFile",
6869
"Use setAppesModeEncoding to change xml encoding from windows-1251 to other",
@@ -2026,7 +2027,7 @@ struct InStream {
20262027
int readManyIteration;
20272028
size_t maxFileSize;
20282029
size_t maxTokenLength;
2029-
size_t maxBlanksCount;
2030+
size_t maxBlankCount;
20302031
size_t maxMessageLength;
20312032

20322033
void init(std::string fileName, TMode mode);
@@ -2845,7 +2846,7 @@ InStream::InStream() {
28452846
readManyIteration = NO_INDEX;
28462847
maxFileSize = 128 * 1024 * 1024; // 128MB.
28472848
maxTokenLength = 32 * 1024 * 1024; // 32MB.
2848-
maxBlanksCount = 32 * 1024 * 1024; // 32MB.
2849+
maxBlankCount = 32 * 1024 * 1024; // 32MB.
28492850
maxMessageLength = 32000;
28502851
}
28512852

@@ -3376,13 +3377,13 @@ void InStream::skipChar() {
33763377
}
33773378

33783379
void InStream::skipBlanks() {
3379-
size_t blanksCount = 0;
3380+
size_t blankCount = 0;
33803381
while (isBlanks(reader->curChar()))
33813382
{
3382-
blanksCount++;
3383-
// You can change maxBlanksCount.
3384-
// Example: 'inf.maxBlanksCount = 128 * 1024 * 1024;'.
3385-
if (blanksCount > maxBlanksCount)
3383+
blankCount++;
3384+
// You can change maxBlankCount.
3385+
// Example: 'inf.maxBlankCount = 32 * 1024 * 1024;'.
3386+
if (blankCount > maxBlankCount)
33863387
quit(_pe, "Too many white-space characters skipped");
33873388
reader->skipChar();
33883389
}

0 commit comments

Comments
 (0)