Skip to content

Commit dd0bc88

Browse files
committed
Fix overwriting bug in fuzzsupport when text is very short
1 parent 6e5283c commit dd0bc88

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Version 10.44 xx-xxx-2024
88
-------------------------
99

1010
1. If a pattern contained a variable-length lookbehind in which the first
11-
branch was not the one with the shortest minimym length, and the lookbehind
11+
branch was not the one with the shortest minimum length, and the lookbehind
1212
contained a capturing group, and elsewhere in the pattern there was another
1313
lookbehind that referenced that group, the pattern was incorrectly compiled,
1414
leading to unpredictable results, including crashes in JIT compiling. An

src/pcre2_fuzzsupport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ Start the scan at the second character so there can be a lookbehind for a
295295
backslash, and end it before the end so that the next character can be checked
296296
for an opening brace. */
297297

298-
for (size_t i = 1; i < size - 2; i++)
298+
if (size > 3) for (size_t i = 1; i < size - 2; i++)
299299
{
300300
size_t j;
301-
301+
302302
if (wdata[i] != ')' || wdata[i-1] == '\\' || wdata[i+1] != '{') continue;
303303
i++; /* Points to '{' */
304304

0 commit comments

Comments
 (0)