- Fixed bug #42071 (ini scanner allows NULL to be used as option name)

# Also fixed a warning
This commit is contained in:
Jani Taskinen 2007-07-23 15:57:08 +00:00
parent 8eaa978e97
commit ea5a211256

View File

@ -60,19 +60,16 @@ void init_ini_scanner(TSRMLS_D)
SCNG(lineno)=1;
}
int zend_ini_scanner_get_lineno(TSRMLS_D)
{
return SCNG(lineno);
}
char *zend_ini_scanner_get_filename(TSRMLS_D)
{
return ini_filename;
}
int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC)
{
if (FAILURE == zend_stream_fixup(fh TSRMLS_CC)) {
@ -86,7 +83,6 @@ int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC)
return SUCCESS;
}
int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC)
{
int len = strlen(str);
@ -123,7 +119,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
<INITIAL>[ ]*("false"|"off"|"no"|"none")[ ]* {
<INITIAL>[ ]*("false"|"off"|"no"|"none"|"null")[ ]* {
Z_STRVAL_P(ini_lval) = zend_strndup("", 0);
Z_STRLEN_P(ini_lval) = 0;
Z_TYPE_P(ini_lval) = IS_STRING;
@ -151,7 +147,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
return SECTION;
}
<INITIAL>["][^"]*["] {
char *p = yytext;
@ -177,10 +172,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
return TC_ENCAPSULATED_STRING;
}
<INITIAL>[&|~$(){}!] {
return yytext[0];
}
<INITIAL>"${" {
return TC_DOLLAR_CURLY;
}
@ -190,6 +181,10 @@ NEWLINE ("\r"|"\n"|"\r\n")
return yytext[0];
}
<INITIAL>[&|~$(){}!] {
return yytext[0];
}
<INITIAL>[^=\n\r\t;|&$~(){}!"\[]+ {
/* STRING */
register int i;