|
25 | 25 | * Copyright (c) 2005-2025 |
26 | 26 | */ |
27 | 27 |
|
28 | | -#define VERSION "0.9.45" |
| 28 | +#define VERSION "0.9.45-SNAPSHOT" |
29 | 29 |
|
30 | 30 | /* |
31 | 31 | * Mike Mirzayanov |
|
63 | 63 | */ |
64 | 64 |
|
65 | 65 | const char *latestFeatures[] = { |
| 66 | + "Added maxBlankCount to InStream to avoid infinite loops in skipBlanks()", |
66 | 67 | "Remove incorrect const attributes", |
67 | 68 | "Added ConstantBoundsLog, VariablesLog to validator testOverviewLogFile", |
68 | 69 | "Use setAppesModeEncoding to change xml encoding from windows-1251 to other", |
@@ -2026,7 +2027,7 @@ struct InStream { |
2026 | 2027 | int readManyIteration; |
2027 | 2028 | size_t maxFileSize; |
2028 | 2029 | size_t maxTokenLength; |
2029 | | - size_t maxBlanksCount; |
| 2030 | + size_t maxBlankCount; |
2030 | 2031 | size_t maxMessageLength; |
2031 | 2032 |
|
2032 | 2033 | void init(std::string fileName, TMode mode); |
@@ -2845,7 +2846,7 @@ InStream::InStream() { |
2845 | 2846 | readManyIteration = NO_INDEX; |
2846 | 2847 | maxFileSize = 128 * 1024 * 1024; // 128MB. |
2847 | 2848 | maxTokenLength = 32 * 1024 * 1024; // 32MB. |
2848 | | - maxBlanksCount = 32 * 1024 * 1024; // 32MB. |
| 2849 | + maxBlankCount = 32 * 1024 * 1024; // 32MB. |
2849 | 2850 | maxMessageLength = 32000; |
2850 | 2851 | } |
2851 | 2852 |
|
@@ -3376,13 +3377,13 @@ void InStream::skipChar() { |
3376 | 3377 | } |
3377 | 3378 |
|
3378 | 3379 | void InStream::skipBlanks() { |
3379 | | - size_t blanksCount = 0; |
| 3380 | + size_t blankCount = 0; |
3380 | 3381 | while (isBlanks(reader->curChar())) |
3381 | 3382 | { |
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) |
3386 | 3387 | quit(_pe, "Too many white-space characters skipped"); |
3387 | 3388 | reader->skipChar(); |
3388 | 3389 | } |
|
0 commit comments