Bug #63874 [Csd]: Segfault if php_strip_whitespace has heredoc
Edit report at https://bugs.php.net/bug.php?id=63874&edit=1 ID: 63874 User updated by:igor at wiedler dot ch Reported by:igor at wiedler dot ch Summary:Segfault if php_strip_whitespace has heredoc Status: Closed Type: Bug Package:Unknown/Other Function Operating System: OSX 10.8.2 PHP Version:5.5Git-2012-12-29 (Git) Block user comment: N Private report: N New Comment: Fix confirmed. Thanks! Previous Comments: [2012-12-30 04:17:38] pierr...@php.net Automatic comment on behalf of pierrick Revision: http://git.php.net/?p=php-src.git;a=commit;h=8228597ecce3ad868d2c6bfca5ff43f29e014296 Log: Fixed bug #63874 (Segfaul if php_strip_whitespace has heredoc) [2012-12-29 22:32:51] igor at wiedler dot ch Description: When a filename that contains a heredoc is passed to php_strip_whitespace, it results in a segmentation fault / buffer overflow. Here is the output from --enable-debug: [Sat Dec 29 22:22:09 2012] Script: '/Users/igor/test.php' --- /Users/igor/src/php-src/Zend/zend_highlight.c(189) : Block 0x1036a66d8 status: Beginning: Cached Freed (invalid) Start: OK End: OK --- Test script: --- https://bugs.php.net/bug.php?id=63874&edit=1
[PHP-BUG] Bug #63874 [NEW]: Buffer overflow if php_strip_whitespace has heredoc
From: igor at wiedler dot ch Operating system: OSX 10.8.2 PHP version: 5.5Git-2012-12-29 (Git) Package: Unknown/Other Function Bug Type: Bug Bug description:Buffer overflow if php_strip_whitespace has heredoc Description: When a filename that contains a heredoc is passed to php_strip_whitespace, it results in a segmentation fault / buffer overflow. Here is the output from --enable-debug: [Sat Dec 29 22:22:09 2012] Script: '/Users/igor/test.php' --- /Users/igor/src/php-src/Zend/zend_highlight.c(189) : Block 0x1036a66d8 status: Beginning: Cached Freed (invalid) Start: OK End: OK --- Test script: --- https://bugs.php.net/bug.php?id=63874&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63874&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63874&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63874&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63874&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63874&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63874&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63874&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63874&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63874&r=support Expected behavior: https://bugs.php.net/fix.php?id=63874&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63874&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63874&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63874&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63874&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63874&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63874&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63874&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63874&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63874&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63874&r=mysqlcfg
Bug #63000 [Com]: MCAST_JOIN_GROUP on OSX is broken
Edit report at https://bugs.php.net/bug.php?id=63000&edit=1 ID: 63000 Comment by: igor at wiedler dot ch Reported by:igor at wiedler dot ch Summary:MCAST_JOIN_GROUP on OSX is broken Status: Open Type: Bug Package:Sockets related Operating System: Mac OSX 10.7, 10.8 PHP Version:5.4.6 Block user comment: N Private report: N New Comment: It's still broken on 10.8, also returning EINVAL. Previous Comments: [2012-09-03 20:08:14] cataphr...@php.net What's the situation in OS X 10.8? I'd prefer not to disable this in versions where it's working. [2012-09-03 05:42:37] larue...@php.net reeze, this one is not like that one you reported. that one is trivial, and in some situation it's not a bug ( empty user name is allowed in theory). but this is a bug. (I didn't test with this, just judge by the reporting) [2012-09-03 02:53:16] reeze dot xia at gmail dot com I haven't use this option before, if it's an important feature, if your patch didn't apply the only impact is the warning issued ? that maybe need to be fixed, but if not... eg this bug https://bugs.php.net/bug.php?id=62881 I reported. maybe the bug reported may set to won't fix :( more conversation see: https://github.com/php/php-src/pull/176 anyway I prefer it get fixed :) [2012-09-03 02:47:47] reeze dot xia at gmail dot com Ah, you mention which version the bug exist, both 10.7&10.8 right ? Is there any way to detect whether is broken or not disable it seems not a better choice. ---------------- [2012-09-02 21:41:13] igor at wiedler dot ch See also: http://trac.videolan.org/vlc/ticket/6104#comment:19 The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=63000 -- Edit this bug report at https://bugs.php.net/bug.php?id=63000&edit=1
Bug #63000 [Com]: MCAST_JOIN_GROUP on OSX is broken
Edit report at https://bugs.php.net/bug.php?id=63000&edit=1 ID: 63000 Comment by: igor at wiedler dot ch Reported by:igor at wiedler dot ch Summary:MCAST_JOIN_GROUP on OSX is broken Status: Open Type: Bug Package:Sockets related Operating System: Mac OSX 10.7, 10.8 PHP Version:5.4.6 Block user comment: N Private report: N New Comment: See also: http://trac.videolan.org/vlc/ticket/6104#comment:19 Previous Comments: [2012-09-02 21:38:36] igor at wiedler dot ch Description: The multicast support in PHP 5.4 makes use of MCAST_JOIN_GROUP if it is present. The problem is that OSX 10.7 added the constant, but did not correctly implement the feature. This causes the setsockopt call to fail. The solution to the problem is to not use MCAST_JOIN_GROUP on OSX. Test script: --- '224.0.0.251', "interface" => 0, )); var_dump($so); Expected result: bool(true) Actual result: -- PHP Warning: socket_set_option(): unable to set socket option [22]: Invalid argument in /Users/igor/code/react-mdns-userland/src/React/Mdns/Client.php on line 27 PHP Stack trace: PHP 1. {main}() /Users/igor/code/react-mdns-userland/examples/client.php:0 PHP 2. React\Mdns\Client->query() /Users/igor/code/react-mdns- userland/examples/client.php:10 PHP 3. socket_set_option() /Users/igor/code/react-mdns- userland/src/React/Mdns/Client.php:27 bool(false) -- Edit this bug report at https://bugs.php.net/bug.php?id=63000&edit=1
[PHP-BUG] Bug #63000 [NEW]: MCAST_JOIN_GROUP on OSX is broken
From: igor at wiedler dot ch Operating system: Mac OSX 10.7, 10.8 PHP version: 5.4.6 Package: Sockets related Bug Type: Bug Bug description:MCAST_JOIN_GROUP on OSX is broken Description: The multicast support in PHP 5.4 makes use of MCAST_JOIN_GROUP if it is present. The problem is that OSX 10.7 added the constant, but did not correctly implement the feature. This causes the setsockopt call to fail. The solution to the problem is to not use MCAST_JOIN_GROUP on OSX. Test script: --- '224.0.0.251', "interface" => 0, )); var_dump($so); Expected result: bool(true) Actual result: -- PHP Warning: socket_set_option(): unable to set socket option [22]: Invalid argument in /Users/igor/code/react-mdns-userland/src/React/Mdns/Client.php on line 27 PHP Stack trace: PHP 1. {main}() /Users/igor/code/react-mdns-userland/examples/client.php:0 PHP 2. React\Mdns\Client->query() /Users/igor/code/react-mdns- userland/examples/client.php:10 PHP 3. socket_set_option() /Users/igor/code/react-mdns- userland/src/React/Mdns/Client.php:27 bool(false) -- Edit bug report at https://bugs.php.net/bug.php?id=63000&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63000&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63000&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63000&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63000&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=63000&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=63000&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63000&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63000&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63000&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63000&r=support Expected behavior: https://bugs.php.net/fix.php?id=63000&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63000&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63000&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63000&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63000&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=63000&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63000&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63000&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63000&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63000&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63000&r=mysqlcfg
Bug #53939 [Opn->Csd]: [intl] IntlDateFormatter::format fails to escape M in "'y-'M"
Edit report at http://bugs.php.net/bug.php?id=53939&edit=1 ID: 53939 User updated by:igor at wiedler dot ch Reported by:igor at wiedler dot ch Summary:[intl] IntlDateFormatter::format fails to escape M in "'y-'M" -Status: Open +Status: Closed Type: Bug Package:*Languages/Translation PHP Version:5.3.5 Block user comment: N Private report: N New Comment: Invalid, closing. Previous Comments: ---- [2011-02-08 11:18:50] igor at wiedler dot ch I discovered this in the ICU documentation: > Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. Example: > .MM.dd G 'at' HH:mm:ss zzz > 1996.07.10 AD at 15:08:56 PDT http://userguide.icu-project.org/formatparse/datetime So the escaping is always between two quote characters, and not an escape character before each escaped character (like with date). Thus, this report is invalid and may be closed. [2011-02-06 18:02:45] igor at wiedler dot ch Oops, the last expected is of course: string(1) "n-M" [2011-02-06 17:52:33] igor at wiedler dot ch Perhaps also worth noting: Script: $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"WTF 'y-'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"n-'M"); var_dump($fmt->format(0)); Actual: string(1) "0" string(1) "-" Expected: string(1) "0T1 1970-1" string(1) "n-1" [2011-02-06 17:42:28] igor at wiedler dot ch Description: When calling IntlDateFormatter::format with the format "'y-'M-'d", it fails to escape the M properly. ' is the escape character of ICU's dateformat. Test script: --- format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'y-'M"); var_dump($fmt->format(0)); Expected result: string(1) "1" string(1) "M" string(3) "y-M" Actual result: -- string(1) "1" string(1) "M" string(3) "y-1" -- Edit this bug report at http://bugs.php.net/bug.php?id=53939&edit=1
Bug #53939 [Com]: [intl] IntlDateFormatter::format fails to escape M in "'y-'M"
Edit report at http://bugs.php.net/bug.php?id=53939&edit=1 ID: 53939 Comment by: igor at wiedler dot ch Reported by:igor at wiedler dot ch Summary:[intl] IntlDateFormatter::format fails to escape M in "'y-'M" Status: Open Type: Bug Package:*Languages/Translation PHP Version:5.3.5 Block user comment: N Private report: N New Comment: I discovered this in the ICU documentation: > Any characters in the pattern that are not in the ranges of ['a'..'z'] and ['A'..'Z'] will be treated as quoted text. For instance, characters like ':', '.', ' ', '#' and '@' will appear in the resulting time text even they are not enclosed within single quotes.The single quote is used to 'escape' letters. Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote. Example: > .MM.dd G 'at' HH:mm:ss zzz > 1996.07.10 AD at 15:08:56 PDT http://userguide.icu-project.org/formatparse/datetime So the escaping is always between two quote characters, and not an escape character before each escaped character (like with date). Thus, this report is invalid and may be closed. Previous Comments: [2011-02-06 18:02:45] igor at wiedler dot ch Oops, the last expected is of course: string(1) "n-M" [2011-02-06 17:52:33] igor at wiedler dot ch Perhaps also worth noting: Script: $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"WTF 'y-'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"n-'M"); var_dump($fmt->format(0)); Actual: string(1) "0" string(1) "-" Expected: string(1) "0T1 1970-1" string(1) "n-1" [2011-02-06 17:42:28] igor at wiedler dot ch Description: When calling IntlDateFormatter::format with the format "'y-'M-'d", it fails to escape the M properly. ' is the escape character of ICU's dateformat. Test script: --- format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'y-'M"); var_dump($fmt->format(0)); Expected result: string(1) "1" string(1) "M" string(3) "y-M" Actual result: -- string(1) "1" string(1) "M" string(3) "y-1" -- Edit this bug report at http://bugs.php.net/bug.php?id=53939&edit=1
Bug #53939 [Com]: [intl] IntlDateFormatter::format fails to escape M in "'y-'M"
Edit report at http://bugs.php.net/bug.php?id=53939&edit=1 ID: 53939 Comment by: igor at wiedler dot ch Reported by:igor at wiedler dot ch Summary:[intl] IntlDateFormatter::format fails to escape M in "'y-'M" Status: Open Type: Bug Package:*Languages/Translation PHP Version:5.3.5 Block user comment: N Private report: N New Comment: Oops, the last expected is of course: string(1) "n-M" Previous Comments: -------- [2011-02-06 17:52:33] igor at wiedler dot ch Perhaps also worth noting: Script: $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"WTF 'y-'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"n-'M"); var_dump($fmt->format(0)); Actual: string(1) "0" string(1) "-" Expected: string(1) "0T1 1970-1" string(1) "n-1" [2011-02-06 17:42:28] igor at wiedler dot ch Description: When calling IntlDateFormatter::format with the format "'y-'M-'d", it fails to escape the M properly. ' is the escape character of ICU's dateformat. Test script: --- format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'y-'M"); var_dump($fmt->format(0)); Expected result: string(1) "1" string(1) "M" string(3) "y-M" Actual result: -- string(1) "1" string(1) "M" string(3) "y-1" -- Edit this bug report at http://bugs.php.net/bug.php?id=53939&edit=1
Bug #53939 [Com]: [intl] IntlDateFormatter::format fails to escape M in "'y-'M"
Edit report at http://bugs.php.net/bug.php?id=53939&edit=1 ID: 53939 Comment by: igor at wiedler dot ch Reported by:igor at wiedler dot ch Summary:[intl] IntlDateFormatter::format fails to escape M in "'y-'M" Status: Open Type: Bug Package:*Languages/Translation PHP Version:5.3.5 Block user comment: N Private report: N New Comment: Perhaps also worth noting: Script: $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"WTF 'y-'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"n-'M"); var_dump($fmt->format(0)); Actual: string(1) "0" string(1) "-" Expected: string(1) "0T1 1970-1" string(1) "n-1" Previous Comments: [2011-02-06 17:42:28] igor at wiedler dot ch Description: When calling IntlDateFormatter::format with the format "'y-'M-'d", it fails to escape the M properly. ' is the escape character of ICU's dateformat. Test script: --- format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'y-'M"); var_dump($fmt->format(0)); Expected result: string(1) "1" string(1) "M" string(3) "y-M" Actual result: -- string(1) "1" string(1) "M" string(3) "y-1" -- Edit this bug report at http://bugs.php.net/bug.php?id=53939&edit=1
[PHP-BUG] Bug #53939 [NEW]: [intl] IntlDateFormatter::format fails to escape M in "'y-'M"
From: Operating system: PHP version: 5.3.5 Package: *Languages/Translation Bug Type: Bug Bug description:[intl] IntlDateFormatter::format fails to escape M in "'y-'M" Description: When calling IntlDateFormatter::format with the format "'y-'M-'d", it fails to escape the M properly. ' is the escape character of ICU's dateformat. Test script: --- format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'M"); var_dump($fmt->format(0)); $fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'UTC', IntlDateFormatter::GREGORIAN ,"'y-'M"); var_dump($fmt->format(0)); Expected result: string(1) "1" string(1) "M" string(3) "y-M" Actual result: -- string(1) "1" string(1) "M" string(3) "y-1" -- Edit bug report at http://bugs.php.net/bug.php?id=53939&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53939&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53939&r=trysnapshot53 Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53939&r=trysnapshottrunk Fixed in SVN: http://bugs.php.net/fix.php?id=53939&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53939&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=53939&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=53939&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=53939&r=needscript Try newer version: http://bugs.php.net/fix.php?id=53939&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=53939&r=support Expected behavior: http://bugs.php.net/fix.php?id=53939&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=53939&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=53939&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=53939&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53939&r=php4 Daylight Savings:http://bugs.php.net/fix.php?id=53939&r=dst IIS Stability: http://bugs.php.net/fix.php?id=53939&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=53939&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=53939&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=53939&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=53939&r=mysqlcfg