]> granicus.if.org Git - php/commitdiff
- Fixed bug #48768 (parse_ini_*() crash with INI_SCANNER_RAW)
authorJani Taskinen <jani@php.net>
Tue, 4 Aug 2009 02:56:26 +0000 (02:56 +0000)
committerJani Taskinen <jani@php.net>
Tue, 4 Aug 2009 02:56:26 +0000 (02:56 +0000)
NEWS
Zend/zend_ini_scanner.l
ext/standard/tests/general_functions/bug48768.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index ece156c4ef42f6aacf7b05f9f0f1cf288e63ba50..762a9b8df1019248009d7150effe213670a3093c 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -68,6 +68,7 @@ PHP                                                                        NEWS
   (Sriram Natarajan)
 - Fixed bug #48771 (rename() between volumes fails and reports no error on 
   Windows). (Pierre)
+- Fixed bug #48768 (parse_ini_*() crash with INI_SCANNER_RAW). (Jani)
 - Fixed bug #48763 (ZipArchive produces corrupt archive). (dani dot church at 
   gmail dot com, Pierre)
 - Fixed bug #48762 (IPv6 address filter still rejects valid address). (Felipe)
index ac1ac76ac2ea4c0957915b9108d5e884e4552c3c..b3143a14ade4a2af88653dbf7d3676854484a4e7 100644 (file)
@@ -315,7 +315,7 @@ DOLLAR_CURLY "${"
 
 SECTION_RAW_CHARS [^\]\n\r]
 SINGLE_QUOTED_CHARS [^']
-RAW_VALUE_CHARS [^=\n\r;]
+RAW_VALUE_CHARS [^\n\r;]
 
 LITERAL_DOLLAR ("$"([^{\000]|("\\"{ANY_CHAR})))
 VALUE_CHARS         ([^$= \t\n\r;&|~()!"'\000]|{LITERAL_DOLLAR})
diff --git a/ext/standard/tests/general_functions/bug48768.phpt b/ext/standard/tests/general_functions/bug48768.phpt
new file mode 100644 (file)
index 0000000..ae8329a
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #48768 (parse_ini_*() crashes with INI_SCANNER_RAW)
+--FILE--
+<?php
+
+$ini_location = dirname(__FILE__) . '/bug48768.tmp';
+
+// Build ini data
+$ini_data = <<< EOT
+equal = "="
+
+EOT;
+
+// Save ini data to file
+file_put_contents($ini_location, $ini_data);
+
+var_dump(parse_ini_file($ini_location, false, INI_SCANNER_RAW));
+var_dump(parse_ini_file($ini_location, false, INI_SCANNER_NORMAL));
+
+?>
+--CLEAN--
+<?php @unlink(dirname(__FILE__) . '/bug48768.tmp'); ?>
+--EXPECT--
+array(1) {
+  ["equal"]=>
+  string(1) "="
+}
+array(1) {
+  ["equal"]=>
+  string(1) "="
+}