summaryrefslogtreecommitdiff
path: root/Zend/zend_ini_scanner.l
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-10-20 13:20:56 +0800
committerXinchen Hui <laruence@gmail.com>2015-10-20 13:20:56 +0800
commitd5f76caf6cf334d1bb4ca69662065b3bb34d76c5 (patch)
treeb741c8805e94ceccd1e2506adc7f6e0c90e3598d /Zend/zend_ini_scanner.l
parent395ef4efb72aab6a660612be4632794f00991d85 (diff)
downloadphp-git-d5f76caf6cf334d1bb4ca69662065b3bb34d76c5.tar.gz
Fixed bug #70748 (Segfault in ini_lex () at Zend/zend_ini_scanner.l)
Diffstat (limited to 'Zend/zend_ini_scanner.l')
-rw-r--r--Zend/zend_ini_scanner.l4
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_ini_scanner.l b/Zend/zend_ini_scanner.l
index 9cf8b4fe0a..84656c69fa 100644
--- a/Zend/zend_ini_scanner.l
+++ b/Zend/zend_ini_scanner.l
@@ -108,7 +108,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat leading whitespace */
#define EAT_LEADING_WHITESPACE() \
- while (yytext[0]) { \
+ while (yyleng) { \
if (yytext[0] == ' ' || yytext[0] == '\t') { \
SCNG(yy_text)++; \
yyleng--; \
@@ -119,7 +119,7 @@ ZEND_API zend_ini_scanner_globals ini_scanner_globals;
/* Eat trailing whitespace + extra char */
#define EAT_TRAILING_WHITESPACE_EX(ch) \
- while (yyleng > 0 && ( \
+ while (yyleng && ( \
(ch != 'X' && yytext[yyleng - 1] == ch) || \
yytext[yyleng - 1] == '\n' || \
yytext[yyleng - 1] == '\r' || \