Skip to content

Commit 7ba8384

Browse files
committed
issue #8564 input buffer overflow, can't enlarge buffer because scanner uses REJECT
When we have a very large "LONGSTRINBLOCK" (e.g. a very large documentation part or an encode executable in e.g. base64 encoding) , there are a lot of lines that have to be read at once, this is not really necessary they can be read sequentially (probably at the cost of some speed)
1 parent e965e5d commit 7ba8384

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pycode.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ LONGSTRINGCHAR [^\\"']
183183
ESCAPESEQ ("\\")(.)
184184
LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ})
185185
SMALLQUOTE ("\"\""|"\""|"'"|"''")
186-
LONGSTRINGBLOCK ({LONGSTRINGITEM}+|{SMALLQUOTE})
186+
LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE})
187187

188188
SHORTSTRING ("'"{SHORTSTRINGITEM}*"'"|'"'{SHORTSTRINGITEM}*'"')
189189
SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ})

src/pyscanner.l

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ LONGSTRINGCHAR [^\\"']
180180
ESCAPESEQ ("\\")(.)
181181
LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ})
182182
SMALLQUOTE ("\"\""|"\""|"'"|"''")
183-
LONGSTRINGBLOCK ({LONGSTRINGITEM}+|{SMALLQUOTE})
183+
LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE})
184184

185185
SHORTSTRING ("'"{SHORTSTRINGITEM}*"'"|'"'{SHORTSTRINGITEM}*'"')
186186
SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ})

0 commit comments

Comments
 (0)