From 7ba8384ec466c47bac353744c6942f5be1dd9ab8 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sun, 23 May 2021 18:50:19 +0200 Subject: 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) --- src/pycode.l | 2 +- src/pyscanner.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pycode.l b/src/pycode.l index 6acf333..f24c8c9 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -183,7 +183,7 @@ LONGSTRINGCHAR [^\\"'] ESCAPESEQ ("\\")(.) LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ}) SMALLQUOTE ("\"\""|"\""|"'"|"''") -LONGSTRINGBLOCK ({LONGSTRINGITEM}+|{SMALLQUOTE}) +LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE}) SHORTSTRING ("'"{SHORTSTRINGITEM}*"'"|'"'{SHORTSTRINGITEM}*'"') SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ}) diff --git a/src/pyscanner.l b/src/pyscanner.l index bf2a914..a34dc18 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -180,7 +180,7 @@ LONGSTRINGCHAR [^\\"'] ESCAPESEQ ("\\")(.) LONGSTRINGITEM ({LONGSTRINGCHAR}|{ESCAPESEQ}) SMALLQUOTE ("\"\""|"\""|"'"|"''") -LONGSTRINGBLOCK ({LONGSTRINGITEM}+|{SMALLQUOTE}) +LONGSTRINGBLOCK ({LONGSTRINGITEM}|{SMALLQUOTE}) SHORTSTRING ("'"{SHORTSTRINGITEM}*"'"|'"'{SHORTSTRINGITEM}*'"') SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ}) -- cgit v0.12