summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2021-03-25 09:43:31 (GMT)
committeralbert-github <albert.tests@gmail.com>2021-03-25 09:43:31 (GMT)
commit5a252b0bb4a888fcf1a58f2a955aaa9f4451e803 (patch)
treec08a7ed01cc6985305671afdeb1da0679518032d
parent9533e6d6e8e69954593da006ab00ea362980bc76 (diff)
downloadDoxygen-5a252b0bb4a888fcf1a58f2a955aaa9f4451e803.zip
Doxygen-5a252b0bb4a888fcf1a58f2a955aaa9f4451e803.tar.gz
Doxygen-5a252b0bb4a888fcf1a58f2a955aaa9f4451e803.tar.bz2
Problem with empty buffer in pyscanner.l
After commit: ``` Commit: 9533e6d6e8e69954593da006ab00ea362980bc76 Date: Wednesday, March 24, 2021 11:44:20 PM Regression: fix potential lockup while parsing python code ``` the package fwupd-1.5.8 crashes with: ``` Reading /cygdrive/e/Fossies/fwupd-1.5.8/contrib/firmware_packager/__init__.py... Parsing file /cygdrive/e/Fossies/fwupd-1.5.8/contrib/firmware_packager/__init__.py... Thread 1 "doxygen" received signal SIGSEGV, Segmentation fault. 0x000000010065ea24 in yyread (yyscanner=0x8005d6930, buf=0x6ffffff60010 "", max_size=262143) at .../doxygen/src/pyscanner.l:1443 1443 yyextra->inputPosition+=c; ```
-rw-r--r--src/pyscanner.l1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pyscanner.l b/src/pyscanner.l
index ed471ed..90f3687 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -1438,6 +1438,7 @@ static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yy_size_t c=0;
+ if (yyextra->inputString.isEmpty()) return 0;
const char *p = yyextra->inputString.data() + yyextra->inputPosition;
while ( c < max_size && *p ) { *buf++ = *p++; c++; }
yyextra->inputPosition+=c;