Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-20 Thread Michael Wallner
On 19 March 2012 20:15, Christopher Jones christopher.jo...@oracle.com wrote:
 Hi Mike,

 Can you update (or get updated) http://qa.php.net/phpt_details.php
 with this feature?

Here we go:
https://github.com/php/web-qa/pull/3



 It's way too buried for my liking, but the path is:

 http://qa.php.net/
 http://qa.php.net/howtohelp.php
 http://qa.php.net/write-test.php

 Then down in the PHPT structure details section is a link title here to
 http://qa.php.net/phpt_details.php

Jeez!

-- 
Regards,
Mike

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-19 Thread Christopher Jones



On 03/17/2012 02:35 AM, Michael Wallner wrote:

mike Sat, 17 Mar 2012 09:35:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324319

Log:
add --PUT-- section support based on POST_RAW

Changed paths:
 U   php/php-src/branches/PHP_5_3/run-tests.php
 U   php/php-src/branches/PHP_5_4/run-tests.php
 U   php/php-src/trunk/run-tests.php


Hi Mike,

Can you update (or get updated) http://qa.php.net/phpt_details.php
with this feature?

Thanks,

Chris



Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21  
\$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = trim($section_text['PUT']);
+   $raw_lines = explode(\n, $post);
+
+   $request = '';
+   $started = false;
+
+   foreach ($raw_lines as $line) {
+
+   if (empty($env['CONTENT_TYPE'])  
preg_match('/^Content-Type:(.*)/i', $line, $res)) {
+   $env['CONTENT_TYPE'] = trim(str_replace(\r, 
'', $res[1]));
+   continue;
+   }
+
+   if ($started) {
+   $request .= \n;
+   }
+
+   $started = true;
+   $request .= $line;
+   }
+
+   $env['CONTENT_LENGTH'] = strlen($request);
+   $env['REQUEST_METHOD'] = 'PUT';
+
+   if (empty($request)) {
+   if ($JUNIT) {
+   $JUNIT['test_total']++;
+   $JUNIT['test_error']++;
+   $JUNIT['result_xml'] .= 'testcase classname='.$shortname.' 
name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+   $JUNIT['result_xml'] .= 'error type=BORKED message=empty 
$request /'.\n;
+   $JUNIT['result_xml'] .= '/testcase'.\n;
+   }
+   return 'BORKED';
+   }
+
+   save_text($tmp_post, $request);
+   $cmd = $php $pass_options $ini_settings -f \$test_file\ 21  
\$tmp_post\;
+
} else if (array_key_exists('POST', $section_text)  
!empty($section_text['POST'])) {

$post = trim($section_text['POST']);

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21  
\$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-19 Thread Christopher Jones



On 03/19/2012 12:08 PM, Michael Wallner wrote:

Hi Chris,

On 19 March 2012 17:30, Christopher Joneschristopher.jo...@oracle.com  wrote:

Hi Mike,

Can you update (or get updated) http://qa.php.net/phpt_details.php
with this feature?


Thanks again for the heads up!  Could you please also reveal how to
get there from the homepage?
I'm just curious... ;)



It's way too buried for my liking, but the path is:

http://qa.php.net/
http://qa.php.net/howtohelp.php
http://qa.php.net/write-test.php

Then down in the PHPT structure details section is a link title here to
http://qa.php.net/phpt_details.php

Chris

--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-19 Thread Michael Wallner
Hi Chris,

On 19 March 2012 17:30, Christopher Jones christopher.jo...@oracle.com wrote:
 Hi Mike,

 Can you update (or get updated) http://qa.php.net/phpt_details.php
 with this feature?

Thanks again for the heads up!  Could you please also reveal how to
get there from the homepage?
I'm just curious... ;)

-- 
Regards,
Mike

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/reflection/php_reflection.c branches/PHP_5_3/ext/reflection/tests/bug61388.phpt branches/PHP_5_4/ext/reflection/php_reflection.c

2012-03-18 Thread Gustavo André dos Santos Lopes
cataphract   Sun, 18 Mar 2012 18:23:27 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324337

Log:
- Fixed bug #61388 (ReflectionObject:getProperties() issues invalid reads
  when get_properties returns a hash table with (inaccessible) dynamic
  numeric properties).

Bug: https://bugs.php.net/61388 (Assigned) ReflectionObject:getProperties 
called on ArrayObject throws Segmentation Fault
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c
A   php/php-src/branches/PHP_5_3/ext/reflection/tests/bug61388.phpt
U   php/php-src/branches/PHP_5_4/ext/reflection/php_reflection.c
A   php/php-src/branches/PHP_5_4/ext/reflection/tests/bug61388.phpt
U   php/php-src/trunk/ext/reflection/php_reflection.c
A   php/php-src/trunk/ext/reflection/tests/bug61388.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-18 18:18:01 UTC (rev 324336)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-18 18:23:27 UTC (rev 324337)
@@ -72,6 +72,13 @@
   . Fixed bug #61088 (Memory leak in readline_callback_handler_install).
 (Nikic, Laruence)

+- Reflection:
+  . Fixed bug #61388 (ReflectionObject:getProperties() issues invalid reads
+when get_properties returns a hash table with (inaccessible) dynamic
+numeric properties). (Gustavo)
+  . Fixed bug #60968 (Late static binding doesn't work with
+ReflectionMethod::invokeArgs()). (Laruence)
+
 - SOAP
   . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
   . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
@@ -90,10 +97,6 @@
 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)

-- Reflection:
-  . Fixed bug #60968 (Late static binding doesn't work with
-ReflectionMethod::invokeArgs()). (Laruence)
-
 - Session:
   . Fixed bug #60860 (session.save_handler=user without defined function core
 dumps). (Felipe)

Modified: php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c
===
--- php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c
2012-03-18 18:18:01 UTC (rev 324336)
+++ php/php-src/branches/PHP_5_3/ext/reflection/php_reflection.c
2012-03-18 18:23:27 UTC (rev 324337)
@@ -3667,6 +3667,13 @@
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
zval *retval = va_arg(args, zval*), member;

+   /* under some circumstances, the properties hash table may contain 
numeric
+* properties (e.g. when casting from array). This is a WONT FIX bug, at
+* least for the moment. Ignore these */
+   if (hash_key-nKeyLength == 0) {
+   return 0;
+   }
+
if (hash_key-arKey[0] == '\0') {
return 0; /* non public cannot be dynamic */
}

Added: php/php-src/branches/PHP_5_3/ext/reflection/tests/bug61388.phpt
===
--- php/php-src/branches/PHP_5_3/ext/reflection/tests/bug61388.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/reflection/tests/bug61388.phpt 
2012-03-18 18:23:27 UTC (rev 324337)
@@ -0,0 +1,32 @@
+--TEST--
+ReflectionObject:getProperties() issues invalid reads when it get_properties 
returns a hash table with (inaccessible) dynamic numeric properties
+--FILE--
+?php
+$x = new ArrayObject();
+$x[0] = 'test string 2';
+$x['test'] = 'test string 3';
+$reflObj = new ReflectionObject($x);
+print_r($reflObj-getProperties(ReflectionProperty::IS_PUBLIC));
+
+$x = (object)array(a, oo = b);
+$reflObj = new ReflectionObject($x);
+print_r($reflObj-getProperties(ReflectionProperty::IS_PUBLIC));
+--EXPECT--
+Array
+(
+[0] = ReflectionProperty Object
+(
+[name] = test
+[class] = ArrayObject
+)
+
+)
+Array
+(
+[0] = ReflectionProperty Object
+(
+[name] = oo
+[class] = stdClass
+)
+
+)


Property changes on: 
php/php-src/branches/PHP_5_3/ext/reflection/tests/bug61388.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_4/ext/reflection/php_reflection.c
===
--- php/php-src/branches/PHP_5_4/ext/reflection/php_reflection.c
2012-03-18 18:18:01 UTC (rev 324336)
+++ php/php-src/branches/PHP_5_4/ext/reflection/php_reflection.c
2012-03-18 18:23:27 UTC (rev 324337)
@@ -3832,6 +3832,13 @@
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
zval *retval = va_arg(args, zval*), member;

+   /* under some circumstances, the properties hash table may contain 
numeric
+* properties (e.g. when casting from 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2012-03-17 Thread Michael Wallner
mike Sat, 17 Mar 2012 09:35:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324319

Log:
add --PUT-- section support based on POST_RAW

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21 
 \$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = trim($section_text['PUT']);
+   $raw_lines = explode(\n, $post);
+
+   $request = '';
+   $started = false;
+
+   foreach ($raw_lines as $line) {
+
+   if (empty($env['CONTENT_TYPE'])  
preg_match('/^Content-Type:(.*)/i', $line, $res)) {
+   $env['CONTENT_TYPE'] = trim(str_replace(\r, 
'', $res[1]));
+   continue;
+   }
+
+   if ($started) {
+   $request .= \n;
+   }
+
+   $started = true;
+   $request .= $line;
+   }
+
+   $env['CONTENT_LENGTH'] = strlen($request);
+   $env['REQUEST_METHOD'] = 'PUT';
+
+   if (empty($request)) {
+   if ($JUNIT) {
+   $JUNIT['test_total']++;
+   $JUNIT['test_error']++;
+   $JUNIT['result_xml'] .= 'testcase 
classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' 
time='.$test_execution_time.''.\n;
+   $JUNIT['result_xml'] .= 'error type=BORKED 
message=empty $request /'.\n;
+   $JUNIT['result_xml'] .= '/testcase'.\n;
+   }
+   return 'BORKED';
+   }
+
+   save_text($tmp_post, $request);
+   $cmd = $php $pass_options $ini_settings -f \$test_file\ 21 
 \$tmp_post\;
+
} else if (array_key_exists('POST', $section_text)  
!empty($section_text['POST'])) {

$post = trim($section_text['POST']);

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:19:10 UTC (rev 
324318)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2012-03-17 09:35:25 UTC (rev 
324319)
@@ -1342,8 +1342,8 @@

$tested = trim($section_text['TEST']);

-   /* For GET/POST tests, check if cgi sapi is available and if it is, use 
it. */
-   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['COOKIE']) || 
!empty($section_text['EXPECTHEADERS'])) {
+   /* For GET/POST/PUT tests, check if cgi sapi is available and if it is, 
use it. */
+   if (!empty($section_text['GET']) || !empty($section_text['POST']) || 
!empty($section_text['POST_RAW']) || !empty($section_text['PUT']) || 
!empty($section_text['COOKIE']) || !empty($section_text['EXPECTHEADERS'])) {
if (isset($php_cgi)) {
$old_php = $php;
$php = $php_cgi . ' -C ';
@@ -1718,6 +1718,46 @@
save_text($tmp_post, $request);
$cmd = $php $pass_options $ini_settings -f \$test_file\ 21 
 \$tmp_post\;

+   } elseif (array_key_exists('PUT', $section_text)  
!empty($section_text['PUT'])) {
+
+   $post = trim($section_text['PUT']);
+   $raw_lines = explode(\n, $post);
+
+   $request = '';
+   $started = false;
+
+   foreach ($raw_lines as $line) 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/tests/streams/bug61115-1.phpt branches/PHP_5_3/ext/standard/tests/streams/bug61115-2.phpt branches/PHP_5_3/ext/standard

2012-03-17 Thread Gustavo André dos Santos Lopes
cataphract   Sat, 17 Mar 2012 19:37:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324324

Log:
- Fixed bug #61371 (resource leak). This bug had two parts, a long standing leak
  already fixed in trunk/5.3 and now merged onto 5.4 and a leak introduced in
  fixing bug #61115. This better fix for #61115 fixes the leak (the inhibition
  for deleting the context was too broad) and so prevents segfaults in new
  circumstances (where the inhibition was not broad enough).

Bugs: https://bugs.php.net/61371 (Verified) stream_context_create() causes 
memory leaks on use streams_socket_create
  https://bugs.php.net/61115 (Assigned) Stream related segfault on fatal 
error in php_stream_context_del_link
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A + php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-1.phpt
(from 
php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt:r324314)
A + php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-2.phpt
(from 
php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt:r324314)
A   php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61371.phpt
U   php/php-src/branches/PHP_5_3/main/streams/streams.c
U   php/php-src/branches/PHP_5_4/ext/standard/streamsfuncs.c
A + php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug61115-1.phpt
(from 
php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt:r324314)
A + php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug61115-2.phpt
(from 
php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt:r324314)
A + php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug61115.phpt
(from 
php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt:r324314)
A   php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug61371.phpt
U   php/php-src/branches/PHP_5_4/main/streams/streams.c
A + php/php-src/trunk/ext/standard/tests/streams/bug61115-1.phpt
(from 
php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt:r324314)
A + php/php-src/trunk/ext/standard/tests/streams/bug61115-2.phpt
(from 
php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt:r324314)
A   php/php-src/trunk/ext/standard/tests/streams/bug61371.phpt
U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-17 17:51:51 UTC (rev 324323)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-17 19:37:30 UTC (rev 324324)
@@ -98,6 +98,8 @@
 SessionHandler::write()). (Ilia)

 - Streams:
+  . Fixed bug #61371 (stream_context_create() causes memory leaks on use
+streams_socket_create). (Gustavo)
   . Fixed bug #61253 (Wrappers opened with errors concurrency problem on ZTS).
 (Gustavo)
   . Fixed bug #61115 (stream related segfault on fatal error in

Copied: php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-1.phpt (from rev 324314, php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt)
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-1.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-1.phpt	2012-03-17 19:37:30 UTC (rev 324324)
@@ -0,0 +1,11 @@
+--TEST--
+Bug #61115: Stream related segfault on fatal error in php_stream_context_del_link - variation 1
+--FILE--
+?php
+
+$fileResourceTemp = fopen('php://temp', 'wr');
+stream_context_get_options($fileResourceTemp);
+ftruncate($fileResourceTemp, PHP_INT_MAX);
+?
+--EXPECTF--
+Fatal error: Allowed memory size of %d bytes exhausted at %s:%d (tried to allocate %d bytes) in %s on line %d

Copied: php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-2.phpt (from rev 324314, php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt)
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-2.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115-2.phpt	2012-03-17 19:37:30 UTC (rev 324324)
@@ -0,0 +1,10 @@
+--TEST--
+Bug #61115: Stream related segfault on fatal error in php_stream_context_del_link - variation 2
+--FILE--
+?php
+stream_socket_client('abc', $var, $var, 0, STREAM_CLIENT_PERSISTENT);
+
+?
+==DONE==
+--EXPECT--
+==DONE==

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61371.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61371.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61371.phpt	2012-03-17 19:37:30 UTC (rev 324324)
@@ -0,0 +1,40 @@
+--TEST--
+Bug #61371: stream_context_create() causes memory leaks on 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/interbase/ibase_service.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/interbase/ibase_service.c trunk/ext/interbase/ibase_service

2012-03-15 Thread Ilia Alshanetsky
iliaaThu, 15 Mar 2012 19:59:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324281

Log:
Fixed bug #60947 (Segmentation fault while executing ibase_db_info)

Bug: https://bugs.php.net/60947 (Assigned) Segmentation fault while executing 
ibase_db_info
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/interbase/ibase_service.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/interbase/ibase_service.c
U   php/php-src/trunk/ext/interbase/ibase_service.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-15 16:04:07 UTC (rev 324280)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-15 19:59:26 UTC (rev 324281)
@@ -29,6 +29,10 @@
 function is by reference). (Nikita Popov)
   . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)

+- Ibase
+  . Fixed bug #60947 (Segmentation fault while executing ibase_db_info).
+(Ilia)
+
 - Installation
   . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones)


Modified: php/php-src/branches/PHP_5_3/ext/interbase/ibase_service.c
===
--- php/php-src/branches/PHP_5_3/ext/interbase/ibase_service.c  2012-03-15 
16:04:07 UTC (rev 324280)
+++ php/php-src/branches/PHP_5_3/ext/interbase/ibase_service.c  2012-03-15 
19:59:26 UTC (rev 324281)
@@ -321,6 +321,7 @@
heap_p = heap_buf + res_size;
}
result += 2;
+   *(result+line_len) = 0;
snprintf(heap_p, heap_buf_size - (heap_buf - 
heap_p), %s\n, result);
heap_p += line_len +2;
goto query_loop; /* repeat until result is 
exhausted */

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-15 16:04:07 UTC (rev 324280)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-15 19:59:26 UTC (rev 324281)
@@ -38,6 +38,10 @@
   . Fixed bug #52719 (array_walk_recursive crashes if third param of the
 function is by reference). (Nikita Popov)

+- Ibase
+  . Fixed bug #60947 (Segmentation fault while executing ibase_db_info).
+(Ilia)
+
 - Installation
   . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones)


Modified: php/php-src/branches/PHP_5_4/ext/interbase/ibase_service.c
===
--- php/php-src/branches/PHP_5_4/ext/interbase/ibase_service.c  2012-03-15 
16:04:07 UTC (rev 324280)
+++ php/php-src/branches/PHP_5_4/ext/interbase/ibase_service.c  2012-03-15 
19:59:26 UTC (rev 324281)
@@ -321,6 +321,7 @@
heap_p = heap_buf + res_size;
}
result += 2;
+   *(result+line_len) = 0;
snprintf(heap_p, heap_buf_size - (heap_buf - 
heap_p), %s\n, result);
heap_p += line_len +2;
goto query_loop; /* repeat until result is 
exhausted */

Modified: php/php-src/trunk/ext/interbase/ibase_service.c
===
--- php/php-src/trunk/ext/interbase/ibase_service.c 2012-03-15 16:04:07 UTC 
(rev 324280)
+++ php/php-src/trunk/ext/interbase/ibase_service.c 2012-03-15 19:59:26 UTC 
(rev 324281)
@@ -321,6 +321,7 @@
heap_p = heap_buf + res_size;
}
result += 2;
+   *(result+line_len) = 0;
snprintf(heap_p, heap_buf_size - (heap_buf - 
heap_p), %s\n, result);
heap_p += line_len +2;
goto query_loop; /* repeat until result is 
exhausted */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt trunk/ext/mysqli/tests/mysqli_report.phpt

2012-03-14 Thread Ulf Wendel
uw   Wed, 14 Mar 2012 14:55:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324242

Log:
Test for MySQL version.Variable is deprecated in MySQL 5.6.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
U   php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
U   php/php-src/trunk/ext/mysqli/tests/mysqli_report.phpt

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:05:54 UTC (rev 324241)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:55:09 UTC (rev 324242)
@@ -194,37 +194,39 @@
 	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
 		printf([017] [%d] %s\n, mysqli_connect_errno(), mysqli_connect_error());

-	// this might cause a warning - no index used
-	if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
-		printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+	if (mysqli_get_server_version($link) = 50600) {
+		// this might cause a warning - no index used
+		if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
+			printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	if (!$row = mysqli_fetch_assoc($res))
-		printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+		if (!$row = mysqli_fetch_assoc($res))
+			printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	$log_slow_query = ('ON' == $row['Value']);
+		$log_slow_query = ('ON' == $row['Value']);

-	if (mysqli_get_server_version($link) = 51011) {
-		// this might cause a warning - no index used
-		if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_queries_not_using_indexes'))
-			printf([020] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+		if (mysqli_get_server_version($link) = 50111) {
+			// this might cause a warning - no index used
+			if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_queries_not_using_indexes'))
+printf([020] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-		if (!$row = mysqli_fetch_assoc($res))
-			printf([021] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+			if (!$row = mysqli_fetch_assoc($res))
+printf([021] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-		$log_queries_not_using_indexes = ('ON' == $row['Value']);
+			$log_queries_not_using_indexes = ('ON' == $row['Value']);

-		if ($log_slow_queries  $log_queries_not_using_indexes) {
+			if ($log_slow_queries  $log_queries_not_using_indexes) {

-			for ($i = 100; $i  2; $i++) {
-if (!mysqli_query($link, INSERT INTO test(id, label) VALUES ($i, 'z')))
-	printf([022 - %d] [%d] %s\n, $i - 99, mysqli_errno($link), mysqli_error($link));
-			}
+for ($i = 100; $i  2; $i++) {
+	if (!mysqli_query($link, INSERT INTO test(id, label) VALUES ($i, 'z')))
+		printf([022 - %d] [%d] %s\n, $i - 99, mysqli_errno($link), mysqli_error($link));
+}

-			// this might cause a warning - no index used
-			if (!$res = @mysqli_query($link, SELECT id, label FROM test WHERE id = 1323))
-printf([023] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+// this might cause a warning - no index used
+if (!$res = @mysqli_query($link, SELECT id, label FROM test WHERE id = 1323))
+	printf([023] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-			mysqli_free_result($res);
+mysqli_free_result($res);
+			}
 		}
 	}


Modified: php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt
===
--- php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:05:54 UTC (rev 324241)
+++ php/php-src/branches/PHP_5_4/ext/mysqli/tests/mysqli_report.phpt	2012-03-14 14:55:09 UTC (rev 324242)
@@ -194,37 +194,39 @@
 	if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
 		printf([017] [%d] %s\n, mysqli_connect_errno(), mysqli_connect_error());

-	// this might cause a warning - no index used
-	if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
-		printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+	if (mysqli_get_server_version($link) = 50600) {
+		// this might cause a warning - no index used
+		if (!$res = @mysqli_query($link, SHOW VARIABLES LIKE 'log_slow_queries'))
+			printf([018] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	if (!$row = mysqli_fetch_assoc($res))
-		printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));
+		if (!$row = mysqli_fetch_assoc($res))
+			printf([019] [%d] %s\n, mysqli_errno($link), mysqli_error($link));

-	$log_slow_query = ('ON' == $row['Value']);
+		$log_slow_query = ('ON' == $row['Value']);

-	if (mysqli_get_server_version($link) = 51011) {
-		// this might cause a 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/pdo_odbc/odbc_stmt.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/pdo_odbc/odbc_stmt.c trunk/ext/pdo_odbc/odbc_stmt.c

2012-03-14 Thread Ilia Alshanetsky
iliaaWed, 14 Mar 2012 20:20:33 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324251

Log:
Fixed bug #61212 (PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO).

Bug: https://bugs.php.net/61212 (Open) PDO ODBC Segfaults on 
SQL_SUCESS_WITH_INFO
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/pdo_odbc/odbc_stmt.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/pdo_odbc/odbc_stmt.c
U   php/php-src/trunk/ext/pdo_odbc/odbc_stmt.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-14 20:08:14 UTC (rev 324250)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-14 20:20:33 UTC (rev 324251)
@@ -47,6 +47,9 @@
   . Fixed bug #61194 (PDO should export compression flag with myslqnd).
 (Johannes)

+- PDO_odbc
+  . Fixed bug #61212 (PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO). (Ilia)
+
 - PDO_pgsql
   . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed
 rows on postgresql = 9). (ben dot pineau at gmail dot com)

Modified: php/php-src/branches/PHP_5_3/ext/pdo_odbc/odbc_stmt.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_odbc/odbc_stmt.c   2012-03-14 
20:08:14 UTC (rev 324250)
+++ php/php-src/branches/PHP_5_3/ext/pdo_odbc/odbc_stmt.c   2012-03-14 
20:20:33 UTC (rev 324251)
@@ -637,12 +637,14 @@

if (C-fetched_len != SQL_NO_TOTAL) {
/* use size suggested by the driver, if it 
knows it */
-   alloced = C-fetched_len + 1;
+   buf = emalloc(C-fetched_len + 1);
+   memcpy(buf, C-data, C-fetched_len);
+   buf[C-fetched_len] = 0;
+   used = C-fetched_len;
+   } else {
+   buf = estrndup(C-data, 256);
+   used = 255; /* not 256; the driver NUL 
terminated the buffer */
}
-
-   buf = emalloc(alloced);
-   memcpy(buf, C-data, 256);
-   used = 255; /* not 256; the driver NUL terminated the 
buffer */

do {
C-fetched_len = 0;

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-14 20:08:14 UTC (rev 324250)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-14 20:20:33 UTC (rev 324251)
@@ -75,6 +75,9 @@
   . Fixed bug #61194 (PDO should export compression flag with myslqnd).
 (Johannes)

+- PDO_odbc
+  . Fixed bug #61212 (PDO ODBC Segfaults on SQL_SUCESS_WITH_INFO). (Ilia)
+
 - Phar
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
 bytes). (Nikita Popov)

Modified: php/php-src/branches/PHP_5_4/ext/pdo_odbc/odbc_stmt.c
===
--- php/php-src/branches/PHP_5_4/ext/pdo_odbc/odbc_stmt.c   2012-03-14 
20:08:14 UTC (rev 324250)
+++ php/php-src/branches/PHP_5_4/ext/pdo_odbc/odbc_stmt.c   2012-03-14 
20:20:33 UTC (rev 324251)
@@ -637,12 +637,14 @@

if (C-fetched_len != SQL_NO_TOTAL) {
/* use size suggested by the driver, if it 
knows it */
-   alloced = C-fetched_len + 1;
+   buf = emalloc(C-fetched_len + 1);
+   memcpy(buf, C-data, C-fetched_len);
+   buf[C-fetched_len] = 0;
+   used = C-fetched_len;
+   } else {
+   buf = estrndup(C-data, 256);
+   used = 255; /* not 256; the driver NUL 
terminated the buffer */
}
-
-   buf = emalloc(alloced);
-   memcpy(buf, C-data, 256);
-   used = 255; /* not 256; the driver NUL terminated the 
buffer */

do {
C-fetched_len = 0;

Modified: php/php-src/trunk/ext/pdo_odbc/odbc_stmt.c
===
--- php/php-src/trunk/ext/pdo_odbc/odbc_stmt.c  2012-03-14 20:08:14 UTC (rev 
324250)
+++ php/php-src/trunk/ext/pdo_odbc/odbc_stmt.c  2012-03-14 20:20:33 UTC (rev 
324251)
@@ -637,12 +637,14 @@

if (C-fetched_len != SQL_NO_TOTAL) {
/* use size suggested by the driver, if it 
knows it */
-   alloced = C-fetched_len + 1;
+   buf = emalloc(C-fetched_len + 1);
+   

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/tests/bug61273.phpt branches/PHP_5_4/Zend/tests/bug61273.phpt trunk/Zend/tests/bug61273.phpt

2012-03-12 Thread Xinchen Hui
laruence Mon, 12 Mar 2012 14:52:02 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324159

Log:
reduce memory usage

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt
U   php/php-src/trunk/Zend/tests/bug61273.phpt

Modified: php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt   2012-03-12 
14:22:08 UTC (rev 324158)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt   2012-03-12 
14:52:02 UTC (rev 324159)
@@ -7,7 +7,7 @@
  * for 5.4 #define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
  * we should trick EG(argument_stack) into growing
  */
-$args = array_fill(0, 64 * 1024 - 64, *);
+$args = array_fill(0, 64 * 1024 - 64, 0);
 call_user_func_array(function($a) {}, $args);
 echo strval(okey);
 --EXPECTF--

Modified: php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt
===
--- php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt   2012-03-12 
14:22:08 UTC (rev 324158)
+++ php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt   2012-03-12 
14:52:02 UTC (rev 324159)
@@ -7,7 +7,7 @@
  * for 5.4 #define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
  * we should trick EG(argument_stack) into growing
  */
-$args = array_fill(0, 64 * 1024 - 64, *);
+$args = array_fill(0, 64 * 1024 - 64, 0);
 call_user_func_array(function($a) {}, $args);
 echo strval(okey);
 --EXPECTF--

Modified: php/php-src/trunk/Zend/tests/bug61273.phpt
===
--- php/php-src/trunk/Zend/tests/bug61273.phpt  2012-03-12 14:22:08 UTC (rev 
324158)
+++ php/php-src/trunk/Zend/tests/bug61273.phpt  2012-03-12 14:52:02 UTC (rev 
324159)
@@ -7,7 +7,7 @@
  * for 5.4 #define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
  * we should trick EG(argument_stack) into growing
  */
-$args = array_fill(0, 64 * 1024 - 64, *);
+$args = array_fill(0, 64 * 1024 - 64, 0);
 call_user_func_array(function($a) {}, $args);
 echo strval(okey);
 --EXPECTF--

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_3/ext/standard/tests/time/bug60222.phpt branches/PHP_5_4/NEWS branches/PHP_5_4/ext/sta

2012-03-12 Thread Ilia Alshanetsky
iliaaMon, 12 Mar 2012 16:53:07 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324163

Log:
Fixed bug #60222 (time_nanosleep() does validate input params).

Bug: https://bugs.php.net/60222 (Open) time_nanosleep won't throw a warning for 
negative second
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
A   php/php-src/branches/PHP_5_3/ext/standard/tests/time/bug60222.phpt
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c
A   php/php-src/branches/PHP_5_4/ext/standard/tests/time/bug60222.phpt
U   php/php-src/trunk/ext/standard/basic_functions.c
A   php/php-src/trunk/ext/standard/tests/time/bug60222.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-12 16:19:10 UTC (rev 324162)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-12 16:53:07 UTC (rev 324163)
@@ -24,6 +24,7 @@
   . Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia)
   . Fixed bug #60227 (header() cannot detect the multi-line header with CR).
 (rui, Gustavo)
+  . Fixed bug #60222 (time_nanosleep() does validate input params). (Ilia)
   . Fixed bug #52719 (array_walk_recursive crashes if third param of the
 function is by reference). (Nikita Popov)
   . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)

Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2012-03-12 
16:19:10 UTC (rev 324162)
+++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2012-03-12 
16:53:07 UTC (rev 324163)
@@ -4497,6 +4497,15 @@
return;
}

+   if (tv_sec  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, The seconds value 
must be greater than 0);
+   RETURN_FALSE;
+   }
+   if (tv_nsec  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, The nanoseconds 
value must be greater than 0);
+   RETURN_FALSE;
+   }
+
php_req.tv_sec = (time_t) tv_sec;
php_req.tv_nsec = tv_nsec;
if (!nanosleep(php_req, php_rem)) {

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/time/bug60222.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/time/bug60222.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/time/bug60222.phpt  
2012-03-12 16:53:07 UTC (rev 324163)
@@ -0,0 +1,15 @@
+--TEST--
+Bug #60222 (time_nanosleep() does validate input params)
+--FILE--
+?php
+   var_dump(time_nanosleep(-1, 0));
+   var_dump(time_nanosleep(0, -1));
+?
+===DONE===
+--EXPECTF--
+Warning: time_nanosleep(): The seconds value must be greater than 0 in %s on 
line %d
+bool(false)
+
+Warning: time_nanosleep(): The nanoseconds value must be greater than 0 in %s 
on line %d
+bool(false)
+===DONE===

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-12 16:19:10 UTC (rev 324162)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-12 16:53:07 UTC (rev 324163)
@@ -87,6 +87,7 @@
 - Standard:
   . Fixed memory leak in substr_replace. (Pierrick)
   . Make max_file_uploads ini directive settable outside of php.ini (Rasmus)
+  . Fixed bug #60222 (time_nanosleep() does validate input params). (Ilia)
   . Fixed bug #60106 (stream_socket_server silently truncates long unix socket
 paths). (Ilia)


Modified: php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c 2012-03-12 
16:19:10 UTC (rev 324162)
+++ php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c 2012-03-12 
16:53:07 UTC (rev 324163)
@@ -4432,6 +4432,15 @@
return;
}

+   if (tv_sec  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, The seconds value 
must be greater than 0);
+   RETURN_FALSE;
+   }
+   if (tv_nsec  0) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, The nanoseconds 
value must be greater than 0);
+   RETURN_FALSE;
+   }
+
php_req.tv_sec = (time_t) tv_sec;
php_req.tv_nsec = tv_nsec;
if (!nanosleep(php_req, php_rem)) {

Added: php/php-src/branches/PHP_5_4/ext/standard/tests/time/bug60222.phpt
===
--- php/php-src/branches/PHP_5_4/ext/standard/tests/time/bug60222.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/standard/tests/time/bug60222.phpt  

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt branches/PHP

2012-03-12 Thread Christopher Jones
sixd Mon, 12 Mar 2012 18:08:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324165

Log:
Test portability and coverage changes

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt
U   php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt
A   php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt
U   php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt
U   php/php-src/branches/PHP_5_3/ext/oci8/tests/drcp_privileged.phpt
U   php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bdouble.phpt
U   php/php-src/branches/PHP_5_4/ext/oci8/tests/array_bind_bfloat.phpt
A   php/php-src/branches/PHP_5_4/ext/oci8/tests/bind_raw_2.phpt
U   php/php-src/branches/PHP_5_4/ext/oci8/tests/bug43497_92.phpt
U   php/php-src/branches/PHP_5_4/ext/oci8/tests/drcp_privileged.phpt
U   php/php-src/trunk/ext/oci8/tests/array_bind_bdouble.phpt
U   php/php-src/trunk/ext/oci8/tests/array_bind_bfloat.phpt
A   php/php-src/trunk/ext/oci8/tests/bind_raw_2.phpt
U   php/php-src/trunk/ext/oci8/tests/bug43497_92.phpt
U   php/php-src/trunk/ext/oci8/tests/drcp_privileged.phpt

Modified: php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt
===
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bdouble.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 ?php
 $target_dbs = array('oracledb' = true, 'timesten' = false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BDOUBLE')) die('skip SQLT_BDOUBLE type not available on older Oracle clients');
 ?
 --FILE--
 ?php

Modified: php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt
===
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/array_bind_bfloat.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -4,6 +4,7 @@
 ?php
 $target_dbs = array('oracledb' = true, 'timesten' = false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
+if (!defined('SQLT_BFLOAT')) die('skip SQLT_BFLOAT type not available on older Oracle clients');
 ?
 --FILE--
 ?php

Added: php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt
===
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -0,0 +1,42 @@
+--TEST--
+bind RAW field with OCI_B_BIN
+--SKIPIF--
+?php
+$target_dbs = array('oracledb' = true, 'timesten' = false);  // test runs on these DBs
+require(dirname(__FILE__).'/skipif.inc');
+?
+--FILE--
+?php
+
+require dirname(__FILE__)./connect.inc;
+
+$stmt = oci_parse($c, create table phptestrawtable( id number(10), fileimage raw(1000)));
+oci_execute($stmt);
+
+$stmt = oci_parse ($c, insert into phptestrawtable (id, fileimage) values (:id, :fileimage));
+$i=1;
+$fileimage = file_get_contents( dirname(__FILE__)./test.gif);
+$fileimage = substr($fileimage, 0, 300);
+
+oci_bind_by_name( $stmt, :id, $i, -1);
+oci_bind_by_name( $stmt, :fileimage, $fileimage, -1, OCI_B_BIN);
+oci_execute($stmt, OCI_DEFAULT);
+oci_commit($c);
+
+$stmt = oci_parse($c, SELECT fileimage FROM phptestrawtable);
+oci_execute($stmt);
+
+$row = oci_fetch_row($stmt);
+var_dump(md5($row[0]));
+var_dump(strlen($row[0]));
+
+$stmt = oci_parse($c, drop table phptestrawtable);
+oci_execute($stmt);
+
+echo Done\n;
+
+?
+--EXPECT--
+string(32) 88b274d7a257ac6f70435b83abd4e26e
+int(300)
+Done


Property changes on: php/php-src/branches/PHP_5_3/ext/oci8/tests/bind_raw_2.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt
===
--- php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt	2012-03-12 17:40:24 UTC (rev 324164)
+++ php/php-src/branches/PHP_5_3/ext/oci8/tests/bug43497_92.phpt	2012-03-12 18:08:34 UTC (rev 324165)
@@ -5,8 +5,12 @@
 $target_dbs = array('oracledb' = true, 'timesten' = false);  // test runs on these DBs
 require(dirname(__FILE__).'/skipif.inc');
 if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
-if (preg_match('/Unknown/', oci_client_version()) != 1) {
-die(skip expected output only valid with Oracle 9gR2 clients);
+ob_start();
+phpinfo(INFO_MODULES);
+$phpinfo = ob_get_clean();
+$iv = preg_match('/Oracle .*Version = (9\.2)/', $phpinfo);
+if ($iv != 1) {
+die (skip 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/spl/spl_array.c branches/PHP_5_3/ext/spl/tests/bug61347.phpt branches/PHP_5_4/NEWS branches/PHP_5_4/ext/spl/spl_array.c branches

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 08:27:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324093

Log:
Fixed bug #61347 (inconsist isset behavior of Arrayobject)

Bug: https://bugs.php.net/61347 (Open) inconsist isset behavior of Arrayobject
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/spl/spl_array.c
A   php/php-src/branches/PHP_5_3/ext/spl/tests/bug61347.phpt
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/spl/spl_array.c
A   php/php-src/branches/PHP_5_4/ext/spl/tests/bug61347.phpt
U   php/php-src/trunk/ext/spl/spl_array.c
A   php/php-src/trunk/ext/spl/tests/bug61347.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-11 04:20:25 UTC (rev 324092)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-11 08:27:55 UTC (rev 324093)
@@ -66,6 +66,7 @@

 - SPL
   . Fixed bug #61326 (ArrayObject comparison). (Gustavo)
+  . Fixed bug #61347 (inconsist isset behavior of Arrayobject). (Laruence)

 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)

Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_array.c
===
--- php/php-src/branches/PHP_5_3/ext/spl/spl_array.c	2012-03-11 04:20:25 UTC (rev 324092)
+++ php/php-src/branches/PHP_5_3/ext/spl/spl_array.c	2012-03-11 08:27:55 UTC (rev 324093)
@@ -578,49 +578,46 @@
 	}

 	switch(Z_TYPE_P(offset)) {
-	case IS_STRING:
-		if (check_empty) {
-			if (zend_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) tmp) != FAILURE) {
-switch (check_empty) {
-	case 0:
-		return Z_TYPE_PP(tmp) != IS_NULL;
-	case 2:
-		return 1;
-	default:
-		return zend_is_true(*tmp);
+		case IS_STRING:
+			{
+HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+if (zend_symtable_find(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) tmp) != FAILURE) {
+	switch (check_empty) {
+		case 0:
+			return Z_TYPE_PP(tmp) != IS_NULL;
+		case 2:
+			return 1;
+		default:
+			return zend_is_true(*tmp);
+	}
 }
+return 0;
 			}
-			return 0;
-		} else {
-			return zend_symtable_exists(spl_array_get_hash_table(intern, 0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1);
-		}
-	case IS_DOUBLE:
-	case IS_RESOURCE:
-	case IS_BOOL:
-	case IS_LONG:
-		if (offset-type == IS_DOUBLE) {
-			index = (long)Z_DVAL_P(offset);
-		} else {
-			index = Z_LVAL_P(offset);
-		}
-		if (check_empty) {
-			HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
-			if (zend_hash_index_find(ht, index, (void **)tmp) != FAILURE) {
-switch (check_empty) {
-	case 0:
-		return Z_TYPE_PP(tmp) != IS_NULL;
-	case 2:
-		return 1;
-	default:
-		return zend_is_true(*tmp);
+		case IS_DOUBLE:
+		case IS_RESOURCE:
+		case IS_BOOL:
+		case IS_LONG:
+			{
+HashTable *ht = spl_array_get_hash_table(intern, 0 TSRMLS_CC);
+if (offset-type == IS_DOUBLE) {
+	index = (long)Z_DVAL_P(offset);
+} else {
+	index = Z_LVAL_P(offset);
 }
+if (zend_hash_index_find(ht, index, (void **)tmp) != FAILURE) {
+	switch (check_empty) {
+		case 0:
+			return Z_TYPE_PP(tmp) != IS_NULL;
+		case 2:
+			return 1;
+		default:
+			return zend_is_true(*tmp);
+	}
+}
+return 0;
 			}
-			return 0;
-		} else {
-			return zend_hash_index_exists(spl_array_get_hash_table(intern, 0 TSRMLS_CC), index);
-		}
-	default:
-		zend_error(E_WARNING, Illegal offset type);
+		default:
+			zend_error(E_WARNING, Illegal offset type);
 	}
 	return 0;
 } /* }}} */

Added: php/php-src/branches/PHP_5_3/ext/spl/tests/bug61347.phpt
===
--- php/php-src/branches/PHP_5_3/ext/spl/tests/bug61347.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/spl/tests/bug61347.phpt	2012-03-11 08:27:55 UTC (rev 324093)
@@ -0,0 +1,40 @@
+--TEST--
+Bug #61347 (inconsist isset behavior of Arrayobject)
+--FILE--
+?php
+$a = array('b' = NULL, 37 = NULL);
+var_dump(isset($a['b'])); //false
+
+$b = new ArrayObject($a);
+var_dump(isset($b['b'])); //false
+var_dump(isset($b[37])); //false
+var_dump(isset($b['no_exists'])); //false
+var_dump(empty($b['b'])); //true
+var_dump(empty($b[37])); //true
+
+var_dump(array_key_exists('b', $b)); //true
+var_dump($b['b']);
+
+$a = array('b' = '', 37 = false);
+$b = new ArrayObject($a);
+var_dump(isset($b['b'])); //true
+var_dump(isset($b[37])); //true
+var_dump(isset($b['no_exists'])); //false
+var_dump(empty($b['b'])); //true
+var_dump(empty($b[37])); //true
+
+
+--EXPECT--
+bool(false)
+bool(false)
+bool(false)
+bool(false)
+bool(true)
+bool(true)
+bool(true)
+NULL
+bool(true)
+bool(true)
+bool(false)
+bool(true)

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/spl/tests/ bug60082.phpt

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 08:30:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324094

Log:
Fix test

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/spl/tests/bug60082.phpt

Modified: php/php-src/branches/PHP_5_3/ext/spl/tests/bug60082.phpt
===
--- php/php-src/branches/PHP_5_3/ext/spl/tests/bug60082.phpt2012-03-11 
08:27:55 UTC (rev 324093)
+++ php/php-src/branches/PHP_5_3/ext/spl/tests/bug60082.phpt2012-03-11 
08:30:30 UTC (rev 324094)
@@ -16,4 +16,6 @@
 ===DONE===
 ?php exit(0); ?
 --EXPECTF--
+Deprecated: Call-time pass-by-reference has been deprecated in %sbug60082.php 
on line %d
+
 Fatal error: main(): Nesting level too deep - recursive dependency? in 
%sbug60082.php on line %d

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/NEWS PHP_5_4/NEWS

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 08:34:06 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324095

Log:
Oops, sorry for my poor english

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_4/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-11 08:30:30 UTC (rev 324094)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-11 08:34:06 UTC (rev 324095)
@@ -66,7 +66,7 @@

 - SPL
   . Fixed bug #61326 (ArrayObject comparison). (Gustavo)
-  . Fixed bug #61347 (inconsist isset behavior of Arrayobject). (Laruence)
+  . Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)

 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-11 08:30:30 UTC (rev 324094)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-11 08:34:06 UTC (rev 324095)
@@ -73,7 +73,7 @@
 ReflectionMethod::invokeArgs()). (Laruence)

 - SPL:
-  . Fixed bug #61347 (inconsist isset behavior of Arrayobject). (Laruence)
+  . Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)

 - Standard:
   . Fixed memory leak in substr_replace. (Pierrick)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/NEWS PHP_5_4/NEWS

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 09:02:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324099

Log:
Re-order them according to README.SVN-RULES

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_4/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-11 08:56:14 UTC (rev 324098)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-11 09:02:00 UTC (rev 324099)
@@ -38,10 +38,10 @@
   . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).

 - PDO_mysql
+  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
+(Johannes)
   . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
 always work). (Johannes)
-  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
-(Johannes)

 - PDO_pgsql
   . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed
@@ -59,14 +59,14 @@

 - SOAP
   . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
   . Fixed bug #60842, #51775 (Chunked response parsing error when
 chunksize length line is  10 bytes). (Ilia)
-  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
-User-Agent header). (carloschilazo at gmail dot com)

 - SPL
+  . Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)
   . Fixed bug #61326 (ArrayObject comparison). (Gustavo)
-  . Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)

 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)
@@ -86,20 +86,20 @@
 (Gustavo)
   . Fixed bug #61115 (stream related segfault on fatal error in
 php_stream_context_link). (Gustavo)
-  . Fixed bug #60106 (stream_socket_server silently truncates long unix
-socket paths). (Ilia)
-  . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not
-detected together with the last read). (Gustavo)
   . Fixed bug #60817 (stream_get_line() reads from stream even when there is
 already sufficient data buffered). stream_get_line() now behaves more like
 fgets(), as is documented. (Gustavo)
+  . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not
+detected together with the last read). (Gustavo)
+  . Fixed bug #60106 (stream_socket_server silently truncates long unix
+socket paths). (Ilia)

 - Tidy:
   . Fixed bug #54682 (tidy null pointer dereference). (Tony, David Soria Parra)

 - XMLRPC:
+  . Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary 
variable). (Nikita Popov)
   . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)
-  . Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary 
variable). (Nikita Popov)

 - Zlib:
   . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikic)

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-11 08:56:14 UTC (rev 324098)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-11 09:02:00 UTC (rev 324099)
@@ -3,9 +3,9 @@
 ?? ??? 2012, PHP 5.4.1 RC1

 - CLI Server:
-  . Connection: close instead of Connection: closed (Gustavo)
   . Implemented FR #60850 (Built in web server does not set
 $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence)
+  . Connection: close instead of Connection: closed (Gustavo)

 - Core:
   . Fixed bug #61225 (Incorect lexing of 0b00*+NUM). (Pierrick)
@@ -51,20 +51,20 @@
 SessionHandler::write()). (Ilia)

 - SOAP
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
   . Fixed bug #60842, #51775 (Chunked response parsing error when
 chunksize length line is  10 bytes). (Ilia)
-  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
-User-Agent header). (carloschilazo at gmail dot com)

 - PDO
   . Fixed bug #61292 (Segfault while calling a method on an overloaded PDO
 object). (Laruence)

 - PDO_mysql
+  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
+(Johannes)
   . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
 always work). (Johannes)
-  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
-(Johannes)

 - Phar
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 09:06:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324100

Log:
Sorry for wrong order again.

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-11 09:02:00 UTC (rev 324099)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-11 09:06:12 UTC (rev 324100)
@@ -38,10 +38,10 @@
   . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).

 - PDO_mysql
+  . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
+always work). (Johannes)
   . Fixed bug #61194 (PDO should export compression flag with myslqnd).
 (Johannes)
-  . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
-always work). (Johannes)

 - PDO_pgsql
   . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/readline/readline.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/readline/readline.c trunk/ext/readline/readline.c

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 09:19:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324104

Log:
Fixed bug #61088 (Memory leak in readline_callback_handler_install).

Bug: https://bugs.php.net/61088 (Assigned) Memory leak in 
readline_callback_handler_install
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/readline/readline.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/readline/readline.c
U   php/php-src/trunk/ext/readline/readline.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-11 09:12:25 UTC (rev 324103)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-11 09:19:38 UTC (rev 324104)
@@ -57,6 +57,10 @@
 - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)

+- Readline:
+  . Fixed bug #61088 (Memory leak in readline_callback_handler_install).
+(Nikic, Laruence)
+
 - SOAP
   . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
   . Fixed bug #60887 (SoapClient ignores user_agent option and sends no

Modified: php/php-src/branches/PHP_5_3/ext/readline/readline.c
===
--- php/php-src/branches/PHP_5_3/ext/readline/readline.c2012-03-11 
09:12:25 UTC (rev 324103)
+++ php/php-src/branches/PHP_5_3/ext/readline/readline.c2012-03-11 
09:19:38 UTC (rev 324104)
@@ -561,9 +561,8 @@
FREE_ZVAL(_prepped_callback);
}

-   MAKE_STD_ZVAL(_prepped_callback);
-   *_prepped_callback = *callback;
-   zval_copy_ctor(_prepped_callback);
+   ALLOC_ZVAL(_prepped_callback);
+   MAKE_COPY_ZVAL(callback, _prepped_callback);

rl_callback_handler_install(prompt, php_rl_callback_handler);


Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-11 09:12:25 UTC (rev 324103)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-11 09:19:38 UTC (rev 324104)
@@ -46,6 +46,10 @@
   . Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
 (Johannes)

+- Readline:
+  . Fixed bug #61088 (Memory leak in readline_callback_handler_install).
+(Nikic, Laruence)
+
 - Session
   . Fixed bug #60634 (Segmentation fault when trying to die() in
 SessionHandler::write()). (Ilia)

Modified: php/php-src/branches/PHP_5_4/ext/readline/readline.c
===
--- php/php-src/branches/PHP_5_4/ext/readline/readline.c2012-03-11 
09:12:25 UTC (rev 324103)
+++ php/php-src/branches/PHP_5_4/ext/readline/readline.c2012-03-11 
09:19:38 UTC (rev 324104)
@@ -576,9 +576,8 @@
FREE_ZVAL(_prepped_callback);
}

-   MAKE_STD_ZVAL(_prepped_callback);
-   *_prepped_callback = *callback;
-   zval_copy_ctor(_prepped_callback);
+   ALLOC_ZVAL(_prepped_callback);
+   MAKE_COPY_ZVAL(callback, _prepped_callback);

rl_callback_handler_install(prompt, php_rl_callback_handler);


Modified: php/php-src/trunk/ext/readline/readline.c
===
--- php/php-src/trunk/ext/readline/readline.c   2012-03-11 09:12:25 UTC (rev 
324103)
+++ php/php-src/trunk/ext/readline/readline.c   2012-03-11 09:19:38 UTC (rev 
324104)
@@ -576,9 +576,8 @@
FREE_ZVAL(_prepped_callback);
}

-   MAKE_STD_ZVAL(_prepped_callback);
-   *_prepped_callback = *callback;
-   zval_copy_ctor(_prepped_callback);
+   ALLOC_ZVAL(_prepped_callback);
+   MAKE_COPY_ZVAL(callback, _prepped_callback);

rl_callback_handler_install(prompt, php_rl_callback_handler);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/.gdbinit branches/PHP_5_4/.gdbinit trunk/.gdbinit

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 15:12:28 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324107

Log:
Fix wrong type in the marco of fetching thread globals

Changed paths:
U   php/php-src/branches/PHP_5_3/.gdbinit
U   php/php-src/branches/PHP_5_4/.gdbinit
U   php/php-src/trunk/.gdbinit

Modified: php/php-src/branches/PHP_5_3/.gdbinit
===
--- php/php-src/branches/PHP_5_3/.gdbinit   2012-03-11 14:44:07 UTC (rev 
324106)
+++ php/php-src/branches/PHP_5_3/.gdbinit   2012-03-11 15:12:28 UTC (rev 
324107)
@@ -1,8 +1,8 @@
 define executor_globals
if basic_functions_module.zts
set $tsrm_ls = ts_resource_ex(0, 0)
-   set $eg = ((zend_executor_globals) (*((void ***) 
$tsrm_ls))[executor_globals_id-1])
-   set $cg = ((zend_compiler_globals) (*((void ***) 
$tsrm_ls))[compiler_globals_id-1])
+   set $eg = ((zend_executor_globals*) (*((void ***) 
$tsrm_ls))[executor_globals_id-1])
+   set $cg = ((zend_compiler_globals*) (*((void ***) 
$tsrm_ls))[compiler_globals_id-1])
else
set $eg = executor_globals
set $cg = compiler_globals

Modified: php/php-src/branches/PHP_5_4/.gdbinit
===
--- php/php-src/branches/PHP_5_4/.gdbinit   2012-03-11 14:44:07 UTC (rev 
324106)
+++ php/php-src/branches/PHP_5_4/.gdbinit   2012-03-11 15:12:28 UTC (rev 
324107)
@@ -1,8 +1,8 @@
 define executor_globals
if basic_functions_module.zts
set $tsrm_ls = ts_resource_ex(0, 0)
-   set $eg = ((zend_executor_globals) (*((void ***) 
$tsrm_ls))[executor_globals_id-1])
-   set $cg = ((zend_compiler_globals) (*((void ***) 
$tsrm_ls))[compiler_globals_id-1])
+   set $eg = ((zend_executor_globals*) (*((void ***) 
$tsrm_ls))[executor_globals_id-1])
+   set $cg = ((zend_compiler_globals*) (*((void ***) 
$tsrm_ls))[compiler_globals_id-1])
else
set $eg = executor_globals
set $cg = compiler_globals

Modified: php/php-src/trunk/.gdbinit
===
--- php/php-src/trunk/.gdbinit  2012-03-11 14:44:07 UTC (rev 324106)
+++ php/php-src/trunk/.gdbinit  2012-03-11 15:12:28 UTC (rev 324107)
@@ -1,8 +1,8 @@
 define executor_globals
if basic_functions_module.zts
set $tsrm_ls = ts_resource_ex(0, 0)
-   set $eg = ((zend_executor_globals) (*((void ***) 
$tsrm_ls))[executor_globals_id-1])
-   set $cg = ((zend_compiler_globals) (*((void ***) 
$tsrm_ls))[compiler_globals_id-1])
+   set $eg = ((zend_executor_globals*) (*((void ***) 
$tsrm_ls))[executor_globals_id-1])
+   set $cg = ((zend_compiler_globals*) (*((void ***) 
$tsrm_ls))[compiler_globals_id-1])
else
set $eg = executor_globals
set $cg = compiler_globals

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/tests/bug61273.phpt branches/PHP_5_3/Zend/zend_execute_API.c branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/tests/bug61273.phpt br

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 15:28:31 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324108

Log:
Fixed bug #61273 (call_user_func_array with more than 16333 arguments leaks / 
crashes)

Bug: https://bugs.php.net/61273 (Assigned) call_user_func_array with more than 
16333 arguments leaks / crashes
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt
U   php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
U   php/php-src/branches/PHP_5_4/NEWS
A   php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt
U   php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c
A   php/php-src/trunk/Zend/tests/bug61273.phpt
U   php/php-src/trunk/Zend/zend_execute_API.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-11 15:12:28 UTC (rev 324107)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-11 15:28:31 UTC (rev 324108)
@@ -3,6 +3,8 @@
 ?? ??? 2012, PHP 5.3.11

 - Core:
+  . Fixed bug #61273 (call_user_func_array with more than 16333 arguments
+leaks / crashes). (Laruence)
   . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)

Added: php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug61273.phpt   2012-03-11 
15:28:31 UTC (rev 324108)
@@ -0,0 +1,15 @@
+--TEST--
+Bug #61273 (call_user_func_array with more than 16333 arguments leaks / 
crashes)
+--FILE--
+?php
+/**
+ * for 5.3 #define ZEND_VM_STACK_PAGE_SIZE ((64 * 1024) - 64)
+ * for 5.4 #define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
+ * we should trick EG(argument_stack) into growing
+ */
+$args = array_fill(0, 64 * 1024 - 64, *);
+call_user_func_array(function($a) {}, $args);
+echo strval(okey);
+--EXPECTF--
+Warning: Parameter 1 to {closure}() expected to be a reference, value given in 
%sbug61273.php on line %d
+okey

Modified: php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2012-03-11 
15:12:28 UTC (rev 324107)
+++ php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2012-03-11 
15:28:31 UTC (rev 324108)
@@ -877,7 +877,7 @@

if (fci-no_separation 

!ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
-   if(i) {
+   if (i || 
UNEXPECTED(UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == 
EG(argument_stack)-top))) {
/* hack to clean up the stack */

zend_vm_stack_push_nocheck((void *) (zend_uintptr_t)i TSRMLS_CC);

zend_vm_stack_clear_multiple(TSRMLS_C);

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-11 15:12:28 UTC (rev 324107)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-11 15:28:31 UTC (rev 324108)
@@ -8,6 +8,8 @@
   . Connection: close instead of Connection: closed (Gustavo)

 - Core:
+  . Fixed bug #61273 (call_user_func_array with more than 16333 arguments
+leaks / crashes). (Laruence)
   . Fixed bug #61225 (Incorect lexing of 0b00*+NUM). (Pierrick)
   . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61106 (Segfault when using header_register_callback). (Nikita

Added: php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt
===
--- php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_4/Zend/tests/bug61273.phpt   2012-03-11 
15:28:31 UTC (rev 324108)
@@ -0,0 +1,15 @@
+--TEST--
+Bug #61273 (call_user_func_array with more than 16333 arguments leaks / 
crashes)
+--FILE--
+?php
+/**
+ * for 5.3 #define ZEND_VM_STACK_PAGE_SIZE ((64 * 1024) - 64)
+ * for 5.4 #define ZEND_VM_STACK_PAGE_SIZE ((16 * 1024) - 16)
+ * we should trick EG(argument_stack) into growing
+ */
+$args = array_fill(0, 64 * 1024 - 64, *);
+call_user_func_array(function($a) {}, $args);
+echo strval(okey);
+--EXPECTF--
+Warning: Parameter 1 to {closure}() expected to be a reference, value given in 
%sbug61273.php on line %d
+okey

Modified: php/php-src/branches/PHP_5_4/Zend/zend_execute_API.c
===
--- 

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ zend_execute_API.c

2012-03-11 Thread Xinchen Hui
laruence Sun, 11 Mar 2012 15:31:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324109

Log:
Typo when merging from trunk

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2012-03-11 
15:28:31 UTC (rev 324108)
+++ php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c2012-03-11 
15:31:19 UTC (rev 324109)
@@ -877,7 +877,7 @@

if (fci-no_separation 

!ARG_MAY_BE_SENT_BY_REF(EX(function_state).function, i + 1)) {
-   if (i || 
UNEXPECTED(UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == 
EG(argument_stack)-top))) {
+   if (i || 
UNEXPECTED(ZEND_VM_STACK_ELEMETS(EG(argument_stack)) == 
EG(argument_stack)-top)) {
/* hack to clean up the stack */

zend_vm_stack_push_nocheck((void *) (zend_uintptr_t)i TSRMLS_CC);

zend_vm_stack_clear_multiple(TSRMLS_C);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/spl/spl_directory.c branches/PHP_5_3/ext/spl/tests/SplFileInfo_001.phpt branches/PHP_5_4/ext/spl/spl_directory.c branches/PHP_5_

2012-03-11 Thread Felipe Pena
felipe   Sun, 11 Mar 2012 15:42:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324110

Log:
- Fixed memory leak when calling SplFileInfo's constructor twice

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c
A   php/php-src/branches/PHP_5_3/ext/spl/tests/SplFileInfo_001.phpt
U   php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c
A   php/php-src/branches/PHP_5_4/ext/spl/tests/SplFileInfo_001.phpt
U   php/php-src/trunk/ext/spl/spl_directory.c
A   php/php-src/trunk/ext/spl/tests/SplFileInfo_001.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-11 15:31:19 UTC (rev 324109)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-11 15:42:57 UTC (rev 324110)
@@ -71,6 +71,7 @@
 chunksize length line is  10 bytes). (Ilia)

 - SPL
+  . Fixed memory leak when calling SplFileInfo's constructor twice. (Felipe)
   . Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)
   . Fixed bug #61326 (ArrayObject comparison). (Gustavo)


Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c
===
--- php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c2012-03-11 
15:31:19 UTC (rev 324109)
+++ php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c2012-03-11 
15:42:57 UTC (rev 324110)
@@ -366,6 +366,10 @@
 void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char 
*path, int len, int use_copy TSRMLS_DC) /* {{{ */
 {
char *p1, *p2;
+
+   if (intern-file_name) {
+   efree(intern-file_name);
+   }

intern-file_name = use_copy ? estrndup(path, len) : path;
intern-file_name_len = len;
@@ -386,7 +390,10 @@
} else {
intern-_path_len = 0;
}
-
+
+   if (intern-_path) {
+   efree(intern-_path);
+   }
intern-_path = estrndup(path, intern-_path_len);
 } /* }}} */


Added: php/php-src/branches/PHP_5_3/ext/spl/tests/SplFileInfo_001.phpt
===
--- php/php-src/branches/PHP_5_3/ext/spl/tests/SplFileInfo_001.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/spl/tests/SplFileInfo_001.phpt 
2012-03-11 15:42:57 UTC (rev 324110)
@@ -0,0 +1,11 @@
+--TEST--
+Testing SplFileInfo calling the constructor twice
+--FILE--
+?php
+$x = new splfileinfo(1);
+$x-__construct(1);
+
+echo done!\n;
+?
+--EXPECT--
+done!

Modified: php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c
===
--- php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c2012-03-11 
15:31:19 UTC (rev 324109)
+++ php/php-src/branches/PHP_5_4/ext/spl/spl_directory.c2012-03-11 
15:42:57 UTC (rev 324110)
@@ -376,6 +376,10 @@
 void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char 
*path, int len, int use_copy TSRMLS_DC) /* {{{ */
 {
char *p1, *p2;
+
+   if (intern-file_name) {
+   efree(intern-file_name);
+   }

intern-file_name = use_copy ? estrndup(path, len) : path;
intern-file_name_len = len;
@@ -396,7 +400,10 @@
} else {
intern-_path_len = 0;
}
-
+
+   if (intern-_path) {
+   efree(intern-_path);
+   }
intern-_path = estrndup(path, intern-_path_len);
 } /* }}} */


Added: php/php-src/branches/PHP_5_4/ext/spl/tests/SplFileInfo_001.phpt
===
--- php/php-src/branches/PHP_5_4/ext/spl/tests/SplFileInfo_001.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/spl/tests/SplFileInfo_001.phpt 
2012-03-11 15:42:57 UTC (rev 324110)
@@ -0,0 +1,11 @@
+--TEST--
+Testing SplFileInfo calling the constructor twice
+--FILE--
+?php
+$x = new splfileinfo(1);
+$x-__construct(1);
+
+echo done!\n;
+?
+--EXPECT--
+done!

Modified: php/php-src/trunk/ext/spl/spl_directory.c
===
--- php/php-src/trunk/ext/spl/spl_directory.c   2012-03-11 15:31:19 UTC (rev 
324109)
+++ php/php-src/trunk/ext/spl/spl_directory.c   2012-03-11 15:42:57 UTC (rev 
324110)
@@ -376,6 +376,10 @@
 void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char 
*path, int len, int use_copy TSRMLS_DC) /* {{{ */
 {
char *p1, *p2;
+
+   if (intern-file_name) {
+   efree(intern-file_name);
+   }

intern-file_name = use_copy ? estrndup(path, len) : path;
intern-file_name_len = len;
@@ -396,7 +400,10 @@
} else {
intern-_path_len = 0;
}
-
+
+   if (intern-_path) {
+   efree(intern-_path);
+   }
intern-_path = estrndup(path, 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/tests/bug60569.phpt branches/PHP_5_3/Zend/zend_exceptions.c branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/tests/bug60569.phpt bra

2012-03-11 Thread Ilia Alshanetsky
iliaaSun, 11 Mar 2012 18:15:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324112

Log:
Fixed bug #60569 (Nullbyte truncates Exception $message).

Bug: https://bugs.php.net/60569 (Open) Nullbyte truncates Exception $message.
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/Zend/tests/bug60569.phpt
U   php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c
U   php/php-src/branches/PHP_5_4/NEWS
A   php/php-src/branches/PHP_5_4/Zend/tests/bug60569.phpt
U   php/php-src/branches/PHP_5_4/Zend/zend_exceptions.c
A   php/php-src/trunk/Zend/tests/bug60569.phpt
U   php/php-src/trunk/Zend/zend_exceptions.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-11 15:56:56 UTC (rev 324111)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-11 18:15:13 UTC (rev 324112)
@@ -21,6 +21,7 @@
   . Fixed bug #60825 (Segfault when running symfony 2 tests).
 (Dmitry, Laruence)
   . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam)
+  . Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia)
   . Fixed bug #60227 (header() cannot detect the multi-line header with CR).
 (rui, Gustavo)
   . Fixed bug #52719 (array_walk_recursive crashes if third param of the

Added: php/php-src/branches/PHP_5_3/Zend/tests/bug60569.phpt
===
(Binary files differ)


Property changes on: php/php-src/branches/PHP_5_3/Zend/tests/bug60569.phpt
___
Added: svn:mime-type
   + application/octet-stream

Modified: php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c 2012-03-11 15:56:56 UTC 
(rev 324111)
+++ php/php-src/branches/PHP_5_3/Zend/zend_exceptions.c 2012-03-11 18:15:13 UTC 
(rev 324112)
@@ -192,7 +192,7 @@
object = getThis();

if (message) {
-   zend_update_property_string(default_exception_ce, object, 
message, sizeof(message)-1, message TSRMLS_CC);
+   zend_update_property_stringl(default_exception_ce, object, 
message, sizeof(message)-1, message, message_len TSRMLS_CC);
}

if (code) {

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-11 15:56:56 UTC (rev 324111)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-11 18:15:13 UTC (rev 324112)
@@ -32,6 +32,7 @@
 error). (Stefan)
   . Fixed bug #60573 (type hinting with self keyword causes weird errors).
 (Laruence)
+  . Fixed bug #60569 (Nullbyte truncates Exception $message). (Ilia)
   . Fixed bug #52719 (array_walk_recursive crashes if third param of the
 function is by reference). (Nikita Popov)


Added: php/php-src/branches/PHP_5_4/Zend/tests/bug60569.phpt
===
(Binary files differ)


Property changes on: php/php-src/branches/PHP_5_4/Zend/tests/bug60569.phpt
___
Added: svn:mime-type
   + application/octet-stream

Modified: php/php-src/branches/PHP_5_4/Zend/zend_exceptions.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_exceptions.c 2012-03-11 15:56:56 UTC 
(rev 324111)
+++ php/php-src/branches/PHP_5_4/Zend/zend_exceptions.c 2012-03-11 18:15:13 UTC 
(rev 324112)
@@ -205,7 +205,7 @@
object = getThis();

if (message) {
-   zend_update_property_string(default_exception_ce, object, 
message, sizeof(message)-1, message TSRMLS_CC);
+   zend_update_property_stringl(default_exception_ce, object, 
message, sizeof(message)-1, message, message_len TSRMLS_CC);
}

if (code) {

Added: php/php-src/trunk/Zend/tests/bug60569.phpt
===
(Binary files differ)


Property changes on: php/php-src/trunk/Zend/tests/bug60569.phpt
___
Added: svn:mime-type
   + application/octet-stream

Modified: php/php-src/trunk/Zend/zend_exceptions.c
===
--- php/php-src/trunk/Zend/zend_exceptions.c2012-03-11 15:56:56 UTC (rev 
324111)
+++ php/php-src/trunk/Zend/zend_exceptions.c2012-03-11 18:15:13 UTC (rev 
324112)
@@ -205,7 +205,7 @@
object = getThis();

if (message) {
-   zend_update_property_string(default_exception_ce, object, 
message, sizeof(message)-1, message TSRMLS_CC);
+   zend_update_property_stringl(default_exception_ce, object, 
message, sizeof(message)-1, message, message_len 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/spl/spl_array.c branches/PHP_5_3/ext/spl/tests/bug61326.phpt branches/PHP_5_4/ext/spl/spl_array.c branches/PHP_5_4/ext/spl/tests

2012-03-10 Thread Gustavo André dos Santos Lopes
cataphract   Sat, 10 Mar 2012 17:19:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324082

Log:
- Fixed bug #61326 (ArrayObject comparison).

Bug: https://bugs.php.net/61326 (Assigned) ArrayObject comparison
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/spl/spl_array.c
A   php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt
U   php/php-src/branches/PHP_5_4/ext/spl/spl_array.c
A   php/php-src/branches/PHP_5_4/ext/spl/tests/bug61326.phpt
U   php/php-src/trunk/ext/spl/spl_array.c
A   php/php-src/trunk/ext/spl/tests/bug61326.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-10 16:24:37 UTC (rev 324081)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-10 17:19:39 UTC (rev 324082)
@@ -47,6 +47,9 @@
   . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed
 rows on postgresql = 9). (ben dot pineau at gmail dot com)

+- PDO_Sqlite extension:
+  . Add createCollation support. (Damien)
+
 - Phar:
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
 bytes). (Nikic)
@@ -60,13 +63,13 @@
 chunksize length line is  10 bytes). (Ilia)
   . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
 User-Agent header). (carloschilazo at gmail dot com)
-
+
+- SPL
+  . Fixed bug #61326 (ArrayObject comparison). (Gustavo)
+
 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)

-- PDO_Sqlite extension:
-  . Add createCollation support. (Damien)
-
 - Reflection:
   . Fixed bug #60968 (Late static binding doesn't work with
 ReflectionMethod::invokeArgs()). (Laruence)

Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_array.c
===
--- php/php-src/branches/PHP_5_3/ext/spl/spl_array.c	2012-03-10 16:24:37 UTC (rev 324081)
+++ php/php-src/branches/PHP_5_3/ext/spl/spl_array.c	2012-03-10 17:19:39 UTC (rev 324082)
@@ -836,6 +836,30 @@
 	std_object_handlers.unset_property(object, member TSRMLS_CC);
 } /* }}} */

+static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+{
+	HashTable			*ht1,
+		*ht2;
+	spl_array_object	*intern1,
+		*intern2;
+	int	result	= 0;
+	zvaltemp_zv;
+
+	intern1	= (spl_array_object*)zend_object_store_get_object(o1 TSRMLS_CC);
+	intern2	= (spl_array_object*)zend_object_store_get_object(o2 TSRMLS_CC);
+	ht1		= spl_array_get_hash_table(intern1, 0 TSRMLS_CC);
+	ht2		= spl_array_get_hash_table(intern2, 0 TSRMLS_CC);
+
+	zend_compare_symbol_tables(temp_zv, ht1, ht2 TSRMLS_CC);
+	result = (int)Z_LVAL(temp_zv);
+	/* if we just compared std.properties, don't do it again */
+	if (result == 0 
+			!(ht1 == intern1-std.properties  ht2 == intern2-std.properties)) {
+		result = std_object_handlers.compare_objects(o1, o2 TSRMLS_CC);
+	}
+	return result;
+} /* }}} */
+
 static int spl_array_skip_protected(spl_array_object *intern, HashTable *aht TSRMLS_DC) /* {{{ */
 {
 	char *string_key;
@@ -2003,6 +2027,8 @@
 	spl_handler_ArrayObject.has_property = spl_array_has_property;
 	spl_handler_ArrayObject.unset_property = spl_array_unset_property;

+	spl_handler_ArrayObject.compare_objects = spl_array_compare_objects;
+
 	REGISTER_SPL_STD_CLASS_EX(ArrayIterator, spl_array_object_new, spl_funcs_ArrayIterator);
 	REGISTER_SPL_IMPLEMENTS(ArrayIterator, Iterator);
 	REGISTER_SPL_IMPLEMENTS(ArrayIterator, ArrayAccess);

Added: php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt
===
--- php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt	2012-03-10 17:19:39 UTC (rev 324082)
@@ -0,0 +1,17 @@
+--TEST--
+Bug #61326: ArrayObject comparison
+--FILE--
+?php
+$aobj1 = new ArrayObject(array(0));
+$aobj2 = new ArrayObject(array(1));
+var_dump($aobj1 == $aobj2);
+
+$aobj3 = new ArrayObject(array(0));
+var_dump($aobj1 == $aobj3);
+
+$aobj3-foo = 'bar';
+var_dump($aobj1 == $aobj3);
+--EXPECT--
+bool(false)
+bool(true)
+bool(false)


Property changes on: php/php-src/branches/PHP_5_3/ext/spl/tests/bug61326.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_4/ext/spl/spl_array.c
===
--- php/php-src/branches/PHP_5_4/ext/spl/spl_array.c	2012-03-10 16:24:37 UTC (rev 324081)
+++ php/php-src/branches/PHP_5_4/ext/spl/spl_array.c	2012-03-10 17:19:39 UTC (rev 324082)
@@ -862,6 +862,30 @@
 	std_object_handlers.unset_property(object, member, key TSRMLS_CC);
 } /* }}} */

+static int spl_array_compare_objects(zval *o1, zval *o2 TSRMLS_DC) /* {{{ */
+{
+	HashTable			*ht1,
+		*ht2;

[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/run-tests.php PHP_5_4/run-tests.php

2012-03-09 Thread Michael Wallner
mike Fri, 09 Mar 2012 19:51:09 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324068

Log:
merge 322758 (detect a php-cgi which is a sibling of php cli)

Changed paths:
_U  php/php-src/branches/PHP_5_3/
U   php/php-src/branches/PHP_5_3/run-tests.php
_U  php/php-src/branches/PHP_5_4/
U   php/php-src/branches/PHP_5_4/run-tests.php


Property changes on: php/php-src/branches/PHP_5_3
___
Modified: svn:mergeinfo
   - /php/php-src/trunk:284726,305015,305018-305019
   + /php/php-src/trunk:284726,305015,305018-305019,322758

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2012-03-09 18:38:18 UTC (rev 
324067)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2012-03-09 19:51:09 UTC (rev 
324068)
@@ -1357,6 +1357,9 @@
} else if (file_exists(./sapi/cgi/php-cgi)) {
$old_php = $php;
$php = realpath(./sapi/cgi/php-cgi) . ' -C ';
+   } else if (file_exists(dirname($php) . /php-cgi)) {
+   $old_php = $php;
+   $php = realpath(dirname($php) . /php-cgi) . ' 
-C ';
} else {
show_result('SKIP', $tested, $tested_file, 
reason: CGI not available);
if ($JUNIT) {


Property changes on: php/php-src/branches/PHP_5_4
___
Modified: svn:mergeinfo
   - /php/php-src/trunk:284726,322419,322421,322423,322963
   + /php/php-src/trunk:284726,322419,322421,322423,322758,322963

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2012-03-09 18:38:18 UTC (rev 
324067)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2012-03-09 19:51:09 UTC (rev 
324068)
@@ -1357,6 +1357,9 @@
} else if (file_exists(./sapi/cgi/php-cgi)) {
$old_php = $php;
$php = realpath(./sapi/cgi/php-cgi) . ' -C ';
+   } else if (file_exists(dirname($php) . /php-cgi)) {
+   $old_php = $php;
+   $php = realpath(dirname($php) . /php-cgi) . ' 
-C ';
} else {
show_result('SKIP', $tested, $tested_file, 
reason: CGI not available);
if ($JUNIT) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/pdo_pgsql/pgsql_driver.c branches/PHP_5_3/ext/pdo_pgsql/tests/bug61267.phpt branches/PHP_5_4/ext/pdo_pgsql/pgsql_driver.c branch

2012-03-08 Thread Gustavo André dos Santos Lopes
cataphract   Thu, 08 Mar 2012 08:52:28 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324014

Log:
- Fixed bug #61267: pdo_pgsql's PDO::exec() returns the number of SELECTed
  rows on postgresql = 9

Bug: https://bugs.php.net/61267 (Open) pdo_pgsql's PDO::exec() returns the 
number of SELECTed rows on postgresql = 9.
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/pdo_pgsql/pgsql_driver.c
A   php/php-src/branches/PHP_5_3/ext/pdo_pgsql/tests/bug61267.phpt
U   php/php-src/branches/PHP_5_4/ext/pdo_pgsql/pgsql_driver.c
A   php/php-src/branches/PHP_5_4/ext/pdo_pgsql/tests/bug61267.phpt
U   php/php-src/trunk/ext/pdo_pgsql/pgsql_driver.c
A   php/php-src/trunk/ext/pdo_pgsql/tests/bug61267.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-08 08:45:31 UTC (rev 324013)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-08 08:52:28 UTC (rev 324014)
@@ -2,10 +2,6 @@
 |||
 ?? ??? 2012, PHP 5.3.11

-- Array:
-  . Fixed bug #52719 (array_walk_recursive crashes if third param of the
-function is by reference). (Nikita Popov)
-
 - Core:
   . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
@@ -25,6 +21,8 @@
   . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam)
   . Fixed bug #60227 (header() cannot detect the multi-line header with CR).
 (rui, Gustavo)
+  . Fixed bug #52719 (array_walk_recursive crashes if third param of the
+function is by reference). (Nikita Popov)
   . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)

 - Installation
@@ -45,8 +43,13 @@
   . Fixed bug #61194 (PDO should export compression flag with myslqnd).
 (Johannes)

+- PDO_pgsql
+  . Fixed bug #61267 (pdo_pgsql's PDO::exec() returns the number of SELECTed
+rows on postgresql = 9). (ben dot pineau at gmail dot com)
+
 - Phar:
-  . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL 
bytes). (Nikic)
+  . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
+bytes). (Nikic)

 - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)

Modified: php/php-src/branches/PHP_5_3/ext/pdo_pgsql/pgsql_driver.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_pgsql/pgsql_driver.c   2012-03-08 
08:45:31 UTC (rev 324013)
+++ php/php-src/branches/PHP_5_3/ext/pdo_pgsql/pgsql_driver.c   2012-03-08 
08:52:28 UTC (rev 324014)
@@ -299,7 +299,7 @@
return -1;
}
H-pgoid = PQoidValue(res);
-   ret = atol(PQcmdTuples(res));
+   ret = (qs == PGRES_COMMAND_OK) ? atol(PQcmdTuples(res)) : 0L;
PQclear(res);

return ret;

Added: php/php-src/branches/PHP_5_3/ext/pdo_pgsql/tests/bug61267.phpt
===
--- php/php-src/branches/PHP_5_3/ext/pdo_pgsql/tests/bug61267.phpt  
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/pdo_pgsql/tests/bug61267.phpt  
2012-03-08 08:52:28 UTC (rev 324014)
@@ -0,0 +1,22 @@
+--TEST--
+PDO::exec() returns 0 when the statement is a SELECT.
+--SKIPIF--
+?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not 
loaded');
+require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require_once dirname(__FILE__) . '/config.inc';
+PDOTest::skip();
+?
+--FILE--
+?php
+require_once dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+require_once dirname(__FILE__) . '/config.inc';
+$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$res = $db-exec('SELECT * from generate_series(1, 42);');
+var_dump($res);
+echo Done\n;
+?
+--EXPECTF--
+int(0)
+Done


Property changes on: 
php/php-src/branches/PHP_5_3/ext/pdo_pgsql/tests/bug61267.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_4/ext/pdo_pgsql/pgsql_driver.c
===
--- php/php-src/branches/PHP_5_4/ext/pdo_pgsql/pgsql_driver.c   2012-03-08 
08:45:31 UTC (rev 324013)
+++ php/php-src/branches/PHP_5_4/ext/pdo_pgsql/pgsql_driver.c   2012-03-08 
08:52:28 UTC (rev 324014)
@@ -299,7 +299,7 @@
return -1;
}
H-pgoid = PQoidValue(res);
-   ret = atol(PQcmdTuples(res));
+   ret = (qs == PGRES_COMMAND_OK) ? atol(PQcmdTuples(res)) : 0L;
PQclear(res);

return ret;

Added: php/php-src/branches/PHP_5_4/ext/pdo_pgsql/tests/bug61267.phpt
===
--- 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_3/ext/standard/file.h branches/PHP_5_3/main/php_streams.h branches/PHP_5_3/main/stream

2012-03-08 Thread Gustavo André dos Santos Lopes
cataphract   Thu, 08 Mar 2012 12:30:59 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324020

Log:
- Fixed bug #61253: Wrappers opened with errors concurrency problem
#NOTE: There is a very small possibility that this will further break
#extensions that access wrapper-{err_stack, err_count}. On PECL SVN, rar is the
#only one and it may leak memory after this. I say further break because
#extensions that do that are already broken (will segfault) under ZTS, which is
#why this patch is necessary.
#There was what I deem as tacit acceptance from 5.3/5.4 RMs on this.

Bug: https://bugs.php.net/61253 (Assigned) Wrappers opened with errors 
concurrency problem
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
U   php/php-src/branches/PHP_5_3/ext/standard/file.h
U   php/php-src/branches/PHP_5_3/main/php_streams.h
U   php/php-src/branches/PHP_5_3/main/streams/streams.c
U   php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c
U   php/php-src/branches/PHP_5_4/ext/standard/file.h
U   php/php-src/branches/PHP_5_4/main/php_streams.h
U   php/php-src/branches/PHP_5_4/main/streams/streams.c
U   php/php-src/trunk/ext/standard/basic_functions.c
U   php/php-src/trunk/ext/standard/file.h
U   php/php-src/trunk/main/php_streams.h
U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-08 12:23:22 UTC (rev 324019)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-08 12:30:59 UTC (rev 324020)
@@ -76,6 +76,8 @@
 SessionHandler::write()). (Ilia)

 - Streams:
+  . Fixed bug #61253 (Wrappers opened with errors concurrency problem on ZTS).
+(Gustavo)
   . Fixed bug #61115 (stream related segfault on fatal error in
 php_stream_context_link). (Gustavo)
   . Fixed bug #60106 (stream_socket_server silently truncates long unix

Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c	2012-03-08 12:23:22 UTC (rev 324019)
+++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c	2012-03-08 12:30:59 UTC (rev 324020)
@@ -3751,6 +3751,8 @@
 	/* Default to global filters only */
 	FG(stream_filters) = NULL;

+	FG(wrapper_errors) = NULL;
+
 	return SUCCESS;
 }
 /* }}} */

Modified: php/php-src/branches/PHP_5_3/ext/standard/file.h
===
--- php/php-src/branches/PHP_5_3/ext/standard/file.h	2012-03-08 12:23:22 UTC (rev 324019)
+++ php/php-src/branches/PHP_5_3/ext/standard/file.h	2012-03-08 12:30:59 UTC (rev 324020)
@@ -123,6 +123,7 @@
 	php_stream_context *default_context;
 	HashTable *stream_wrappers;			/* per-request copy of url_stream_wrappers_hash */
 	HashTable *stream_filters;			/* per-request copy of stream_filters_hash */
+	HashTable *wrapper_errors;			/* key: wrapper address; value: linked list of char* */
 } php_file_globals;

 #ifdef ZTS

Modified: php/php-src/branches/PHP_5_3/main/php_streams.h
===
--- php/php-src/branches/PHP_5_3/main/php_streams.h	2012-03-08 12:23:22 UTC (rev 324019)
+++ php/php-src/branches/PHP_5_3/main/php_streams.h	2012-03-08 12:30:59 UTC (rev 324020)
@@ -162,8 +162,8 @@
 	int is_url;		/* so that PG(allow_url_fopen) can be respected */

 	/* support for wrappers to return (multiple) error messages to the stream opener */
-	int err_count;
-	char **err_stack;
+	int err_count;	/* unused */
+	char **err_stack;/* unusued */
 };

 #define PHP_STREAM_FLAG_NO_SEEK		1

Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c
===
--- php/php-src/branches/PHP_5_3/main/streams/streams.c	2012-03-08 12:23:22 UTC (rev 324019)
+++ php/php-src/branches/PHP_5_3/main/streams/streams.c	2012-03-08 12:30:59 UTC (rev 324020)
@@ -148,20 +148,35 @@

 /* }}} */

+static zend_llist *php_get_wrapper_errors_list(php_stream_wrapper *wrapper TSRMLS_DC)
+{
+zend_llist *list = NULL;
+if (!FG(wrapper_errors)) {
+return NULL;
+} else {
+zend_hash_find(FG(wrapper_errors), (const char*)wrapper,
+sizeof wrapper, (void**)list);
+return list;
+}
+}
+
 /* {{{ wrapper error reporting */
 void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const char *path, const char *caption TSRMLS_DC)
 {
 	char *tmp = estrdup(path);
 	char *msg;
 	int free_msg = 0;
-	php_stream_wrapper orig_wrapper;

 	if (wrapper) {
-		if (wrapper-err_count  0) {
+		zend_llist *err_list = php_get_wrapper_errors_list(wrapper TSRMLS_CC);
+		if (err_list) {
+			size_t l = 0;
+			int brlen;
 			int i;
-			size_t l;
-			int brlen;
-			char 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/streams.c branches/PHP_5_4/main/streams/streams.c trunk/main/streams/streams.c

2012-03-08 Thread Gustavo André dos Santos Lopes
cataphract   Thu, 08 Mar 2012 12:39:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324021

Log:
- Oops committed old version of the patch in r324020. Fixed. See bug #61253.

Bug: https://bugs.php.net/61253 (Assigned) Wrappers opened with errors 
concurrency problem
  
Changed paths:
U   php/php-src/branches/PHP_5_3/main/streams/streams.c
U   php/php-src/branches/PHP_5_4/main/streams/streams.c
U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c
===
--- php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-03-08 12:30:59 UTC 
(rev 324020)
+++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-03-08 12:39:48 UTC 
(rev 324021)
@@ -201,7 +201,7 @@
err_buf_p = 
zend_llist_get_next_ex(err_list, pos), i++) {
strcat(msg, *err_buf_p);
if (i  count - 1) {
-   l += brlen;
+   strcat(msg, br);
}
}


Modified: php/php-src/branches/PHP_5_4/main/streams/streams.c
===
--- php/php-src/branches/PHP_5_4/main/streams/streams.c 2012-03-08 12:30:59 UTC 
(rev 324020)
+++ php/php-src/branches/PHP_5_4/main/streams/streams.c 2012-03-08 12:39:48 UTC 
(rev 324021)
@@ -210,7 +210,7 @@
err_buf_p = 
zend_llist_get_next_ex(err_list, pos), i++) {
strcat(msg, *err_buf_p);
if (i  count - 1) {
-   l += brlen;
+   strcat(msg, br);
}
}


Modified: php/php-src/trunk/main/streams/streams.c
===
--- php/php-src/trunk/main/streams/streams.c2012-03-08 12:30:59 UTC (rev 
324020)
+++ php/php-src/trunk/main/streams/streams.c2012-03-08 12:39:48 UTC (rev 
324021)
@@ -210,7 +210,7 @@
err_buf_p = 
zend_llist_get_next_ex(err_list, pos), i++) {
strcat(msg, *err_buf_p);
if (i  count - 1) {
-   l += brlen;
+   strcat(msg, br);
}
}


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/session/session.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/session/session.c trunk/ext/session/session.c

2012-03-07 Thread Ilia Alshanetsky
iliaaThu, 08 Mar 2012 03:31:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=324009

Log:
Fixed bug #60634 (Segmentation fault when trying to die() in 
SessionHandler::write())

Bug: https://bugs.php.net/60634 (Assigned) Segmentation fault when trying to 
die() in SessionHandler::write()
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/session/session.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/session/session.c
U   php/php-src/trunk/ext/session/session.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-07 19:47:18 UTC (rev 324008)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-08 03:31:46 UTC (rev 324009)
@@ -52,6 +52,7 @@
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)

 - SOAP
+  . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
   . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
 User-Agent header). (carloschilazo at gmail dot com)

@@ -61,9 +62,6 @@
 - PDO_Sqlite extension:
   . Add createCollation support. (Damien)

-- SOAP:
-  . Fixed basic HTTP authentication for WSDL sub requests. (Dmitry)
-
 - Reflection:
   . Fixed bug #60968 (Late static binding doesn't work with
 ReflectionMethod::invokeArgs()). (Laruence)
@@ -71,6 +69,8 @@
 - Session:
   . Fixed bug #60860 (session.save_handler=user without defined function core
 dumps). (Felipe)
+  . Fixed bug #60634 (Segmentation fault when trying to die() in
+SessionHandler::write()). (Ilia)

 - Streams:
   . Fixed bug #61115 (stream related segfault on fatal error in

Modified: php/php-src/branches/PHP_5_3/ext/session/session.c
===
--- php/php-src/branches/PHP_5_3/ext/session/session.c  2012-03-07 19:47:18 UTC 
(rev 324008)
+++ php/php-src/branches/PHP_5_3/ext/session/session.c  2012-03-08 03:31:46 UTC 
(rev 324009)
@@ -1512,9 +1512,7 @@
 {
if (PS(session_status) == php_session_active) {
PS(session_status) = php_session_none;
-   zend_try {
-   php_session_save_current_state(TSRMLS_C);
-   } zend_end_try();
+   php_session_save_current_state(TSRMLS_C);
}
 }
 /* }}} */
@@ -2167,7 +2165,9 @@
 {
int i;

-   php_session_flush(TSRMLS_C);
+   zend_try {
+   php_session_flush(TSRMLS_C);
+   } zend_end_try();
php_rshutdown_session_globals(TSRMLS_C);

/* this should NOT be done in php_rshutdown_session_globals() */

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-07 19:47:18 UTC (rev 324008)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-08 03:31:46 UTC (rev 324009)
@@ -44,6 +44,10 @@
   . Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
 (Johannes)

+- Session
+  . Fixed bug #60634 (Segmentation fault when trying to die() in
+SessionHandler::write()). (Ilia)
+
 - SOAP
   . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
 User-Agent header). (carloschilazo at gmail dot com)

Modified: php/php-src/branches/PHP_5_4/ext/session/session.c
===
--- php/php-src/branches/PHP_5_4/ext/session/session.c  2012-03-07 19:47:18 UTC 
(rev 324008)
+++ php/php-src/branches/PHP_5_4/ext/session/session.c  2012-03-08 03:31:46 UTC 
(rev 324009)
@@ -1450,9 +1450,7 @@
 {
if (PS(session_status) == php_session_active) {
PS(session_status) = php_session_none;
-   zend_try {
-   php_session_save_current_state(TSRMLS_C);
-   } zend_end_try();
+   php_session_save_current_state(TSRMLS_C);
}
 }
 /* }}} */
@@ -2142,7 +2140,9 @@
 {
int i;

-   php_session_flush(TSRMLS_C);
+   zend_try {
+   php_session_flush(TSRMLS_C);
+   } zend_end_try();
php_rshutdown_session_globals(TSRMLS_C);

/* this should NOT be done in php_rshutdown_session_globals() */

Modified: php/php-src/trunk/ext/session/session.c
===
--- php/php-src/trunk/ext/session/session.c 2012-03-07 19:47:18 UTC (rev 
324008)
+++ php/php-src/trunk/ext/session/session.c 2012-03-08 03:31:46 UTC (rev 
324009)
@@ -1450,9 +1450,7 @@
 {
if (PS(session_status) == php_session_active) {
PS(session_status) = php_session_none;
-   zend_try {
-   php_session_save_current_state(TSRMLS_C);
-   } zend_end_try();
+   php_session_save_current_state(TSRMLS_C);
}
 }
 /* }}} */
@@ -2142,7 +2140,9 @@
 {
int i;

-   

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ README.ZEND_MM zend_API.c

2012-03-06 Thread Derick Rethans
derick   Tue, 06 Mar 2012 18:25:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323961

Log:
Add the ZEND_DONT_UNLOAD_MODULES environment variable for debugging to 5.3 as
well.

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM
===
--- php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 17:42:59 UTC 
(rev 323960)
+++ php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 18:25:55 UTC 
(rev 323961)
@@ -24,6 +24,14 @@

 $ USE_ZEND_ALLOC=0 valgrind --leak-check=full sapi/cli/php -r 'leak();'

+Shared extensions:
+--
+
+Since PHP 5.4 it is possible to prevent shared extensions from unloading so
+that valgrind can correctly track the memory leaks in shared extensions. For
+this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
+DL_UNLOAD() is skipped during the shutdown of shared extensions.
+
 Tweaking:
 -


Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-06 17:42:59 UTC 
(rev 323960)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-06 18:25:55 UTC 
(rev 323961)
@@ -2137,7 +2137,7 @@

 #if HAVE_LIBDL
 #if !(defined(NETWARE)  defined(APACHE_1_BUILD))
-   if (module-handle) {
+   if (module-handle  !getenv(ZEND_DONT_UNLOAD_MODULES)) {
DL_UNLOAD(module-handle);
}
 #endif

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ README.ZEND_MM zend_API.c

2012-03-06 Thread Stas Malyshev

Hi!


+Since PHP 5.4 it is possible to prevent shared extensions from unloading so


Since 5.4 doesn't look right in 5.3 upgrading :) ITYM since 5.3.11?

--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/README.ZEND_MM branches/PHP_5_4/Zend/README.ZEND_MM trunk/Zend/README.ZEND_MM

2012-03-06 Thread Derick Rethans
derick   Tue, 06 Mar 2012 18:34:10 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323962

Log:
Fixed version numbers.

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM
U   php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM
U   php/php-src/trunk/Zend/README.ZEND_MM

Modified: php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM
===
--- php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 18:25:55 UTC 
(rev 323961)
+++ php/php-src/branches/PHP_5_3/Zend/README.ZEND_MM2012-03-06 18:34:10 UTC 
(rev 323962)
@@ -27,7 +27,7 @@
 Shared extensions:
 --

-Since PHP 5.4 it is possible to prevent shared extensions from unloading so
+Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
 that valgrind can correctly track the memory leaks in shared extensions. For
 this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
 DL_UNLOAD() is skipped during the shutdown of shared extensions.

Modified: php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM
===
--- php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM2012-03-06 18:25:55 UTC 
(rev 323961)
+++ php/php-src/branches/PHP_5_4/Zend/README.ZEND_MM2012-03-06 18:34:10 UTC 
(rev 323962)
@@ -27,7 +27,7 @@
 Shared extensions:
 --

-Since PHP 5.4 it is possible to prevent shared extensions from unloading so
+Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
 that valgrind can correctly track the memory leaks in shared extensions. For
 this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
 DL_UNLOAD() is skipped during the shutdown of shared extensions.

Modified: php/php-src/trunk/Zend/README.ZEND_MM
===
--- php/php-src/trunk/Zend/README.ZEND_MM   2012-03-06 18:25:55 UTC (rev 
323961)
+++ php/php-src/trunk/Zend/README.ZEND_MM   2012-03-06 18:34:10 UTC (rev 
323962)
@@ -27,7 +27,7 @@
 Shared extensions:
 --

-Since PHP 5.4 it is possible to prevent shared extensions from unloading so
+Since PHP 5.3.11 it is possible to prevent shared extensions from unloading so
 that valgrind can correctly track the memory leaks in shared extensions. For
 this there is the ZEND_DONT_UNLOAD_MODULES environment variable. If set, then
 DL_UNLOAD() is skipped during the shutdown of shared extensions.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/Zend/ README.ZEND_MM zend_API.c

2012-03-06 Thread Derick Rethans
On Tue, 6 Mar 2012, Stas Malyshev wrote:

  +Since PHP 5.4 it is possible to prevent shared extensions from  unloading 
  so
 
 Since 5.4 doesn't look right in 5.3 upgrading :) ITYM since 5.3.11?

Fixed, thanks :-)

Derick

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/zend_API.c branches/PHP_5_4/Zend/zend_API.c trunk/Zend/zend_API.c

2012-03-05 Thread Dmitry Stogov
dmitry   Mon, 05 Mar 2012 12:47:25 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323908

Log:
Fixed module numbering

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
U   php/php-src/branches/PHP_5_4/Zend/zend_API.c
U   php/php-src/trunk/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-05 12:21:39 UTC 
(rev 323907)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-03-05 12:47:25 UTC 
(rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 /* this function doesn't check for too many parameters */
@@ -2184,7 +2183,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-   return ++module_count;
+   return zend_hash_num_elements(module_registry) + 1;
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_4/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_API.c2012-03-05 12:21:39 UTC 
(rev 323907)
+++ php/php-src/branches/PHP_5_4/Zend/zend_API.c2012-03-05 12:47:25 UTC 
(rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 static zend_module_entry **module_request_startup_handlers;
@@ -2381,7 +2380,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-   return ++module_count;
+   return zend_hash_num_elements(module_registry) + 1;
 }
 /* }}} */


Modified: php/php-src/trunk/Zend/zend_API.c
===
--- php/php-src/trunk/Zend/zend_API.c   2012-03-05 12:21:39 UTC (rev 323907)
+++ php/php-src/trunk/Zend/zend_API.c   2012-03-05 12:47:25 UTC (rev 323908)
@@ -33,7 +33,6 @@
 #endif

 /* these variables are true statics/globals, and have to be mutex'ed on every 
access */
-static int module_count=0;
 ZEND_API HashTable module_registry;

 static zend_module_entry **module_request_startup_handlers;
@@ -2381,7 +2380,7 @@
 /* return the next free module number */
 int zend_next_free_module(void) /* {{{ */
 {
-   return ++module_count;
+   return zend_hash_num_elements(module_registry) + 1;
 }
 /* }}} */


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/soap/php_sdl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/soap/php_sdl.c trunk/ext/soap/php_sdl.c

2012-03-05 Thread Dmitry Stogov
dmitry   Mon, 05 Mar 2012 12:59:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323909

Log:
Fixed bug #60887 (SoapClient ignores user_agent option and sends no User-Agent 
header)

Bug: https://bugs.php.net/60887 (Assigned) SoapClient ignores user_agent option 
and sends no User-Agent header
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
U   php/php-src/trunk/ext/soap/php_sdl.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
@@ -41,7 +41,11 @@

 - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)
-
+
+- SOAP
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
+
 - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)


Modified: php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-03-05 12:47:25 UTC 
(rev 323908)
+++ php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c 2012-03-05 12:59:01 UTC 
(rev 323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc();
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
sizeof(_user_agent), (void **) tmp) == SUCCESS 
+   Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
+   smart_str_appends(headers, User-Agent: );
+   smart_str_appends(headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(headers, \r\n);
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_host, 
sizeof(_proxy_host), (void **) proxy_host) == SUCCESS 
Z_TYPE_PP(proxy_host) == IS_STRING 
zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_port, 
sizeof(_proxy_port), (void **) proxy_port) == SUCCESS 

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
@@ -38,6 +38,10 @@
 - mbstring:
   . MFH mb_ereg_replace_callback() for security enhancements. (Rui)

+- SOAP
+  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
+User-Agent header). (carloschilazo at gmail dot com)
+
 - Phar
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
 bytes). (Nikita Popov)

Modified: php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
===
--- php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-03-05 12:47:25 UTC 
(rev 323908)
+++ php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c 2012-03-05 12:59:01 UTC 
(rev 323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc(TSRMLS_C);
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
sizeof(_user_agent), (void **) tmp) == SUCCESS 
+   Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
+   smart_str_appends(headers, User-Agent: );
+   smart_str_appends(headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(headers, \r\n);
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_host, 
sizeof(_proxy_host), (void **) proxy_host) == SUCCESS 
Z_TYPE_PP(proxy_host) == IS_STRING 
zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_port, 
sizeof(_proxy_port), (void **) proxy_port) == SUCCESS 

Modified: php/php-src/trunk/ext/soap/php_sdl.c
===
--- php/php-src/trunk/ext/soap/php_sdl.c2012-03-05 12:47:25 UTC (rev 
323908)
+++ php/php-src/trunk/ext/soap/php_sdl.c2012-03-05 12:59:01 UTC (rev 
323909)
@@ -3259,6 +3259,13 @@
context = php_stream_context_alloc(TSRMLS_C);
}

+   if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
sizeof(_user_agent), (void **) tmp) == SUCCESS 
+   Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
+   smart_str_appends(headers, User-Agent: );
+   smart_str_appends(headers, Z_STRVAL_PP(tmp));
+   smart_str_appends(headers, \r\n);
+   }
+
if (zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_host, 
sizeof(_proxy_host), (void **) proxy_host) == SUCCESS 
Z_TYPE_PP(proxy_host) == IS_STRING 
zend_hash_find(Z_OBJPROP_P(this_ptr), _proxy_port, 
sizeof(_proxy_port), (void **) proxy_port) == SUCCESS 

-- 
PHP CVS Mailing List (http://www.php.net/)
To 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/soap/php_sdl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/soap/php_sdl.c trunk/ext/soap/php_sdl.c

2012-03-05 Thread Hannes Magnusson
On Mon, Mar 5, 2012 at 13:59, Dmitry Stogov dmi...@php.net wrote:
 dmitry                                   Mon, 05 Mar 2012 12:59:01 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323909

 Log:
 Fixed bug #60887 (SoapClient ignores user_agent option and sends no 
 User-Agent header)

 Bug: https://bugs.php.net/60887 (Assigned) SoapClient ignores user_agent 
 option and sends no User-Agent header

 Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
    U   php/php-src/branches/PHP_5_4/NEWS
    U   php/php-src/branches/PHP_5_4/ext/soap/php_sdl.c
    U   php/php-src/trunk/ext/soap/php_sdl.c

 Modified: php/php-src/branches/PHP_5_3/NEWS
 ===
 --- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:47:25 UTC (rev 323908)
 +++ php/php-src/branches/PHP_5_3/NEWS   2012-03-05 12:59:01 UTC (rev 323909)
 @@ -41,7 +41,11 @@

  - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)
 -
 +
 +- SOAP
 +  . Fixed bug #60887 (SoapClient ignores user_agent option and sends no
 +    User-Agent header). (carloschilazo at gmail dot com)
 +
  - SQLite3 extension:
   . Add createCollation() method. (Brad Dewar)


 Modified: php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c
 ===
 --- php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c     2012-03-05 12:47:25 
 UTC (rev 323908)
 +++ php/php-src/branches/PHP_5_3/ext/soap/php_sdl.c     2012-03-05 12:59:01 
 UTC (rev 323909)
 @@ -3259,6 +3259,13 @@
                context = php_stream_context_alloc();
        }

 +       if (zend_hash_find(Z_OBJPROP_P(this_ptr), _user_agent, 
 sizeof(_user_agent), (void **) tmp) == SUCCESS 
 +           Z_TYPE_PP(tmp) == IS_STRING  Z_STRLEN_PP(tmp)  0) {
 +               smart_str_appends(headers, User-Agent: );
 +               smart_str_appends(headers, Z_STRVAL_PP(tmp));
 +               smart_str_appends(headers, \r\n);
 +       }

Shouldn't it fallback on the ini option?

-Hannes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/win32/inet.h PHP_5_4/win32/inet.h

2012-03-05 Thread Pierre Joye
pajoye   Mon, 05 Mar 2012 20:53:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323926

Log:
- fix bug #61290, fix build

Bug: https://bugs.php.net/61290 (Open) php_sockets build failure - unresolved 
external symbol _inet_aton
  
Changed paths:
U   php/php-src/branches/PHP_5_3/win32/inet.h
U   php/php-src/branches/PHP_5_4/win32/inet.h

Modified: php/php-src/branches/PHP_5_3/win32/inet.h
===
--- php/php-src/branches/PHP_5_3/win32/inet.h   2012-03-05 20:14:55 UTC (rev 
323925)
+++ php/php-src/branches/PHP_5_3/win32/inet.h   2012-03-05 20:53:40 UTC (rev 
323926)
@@ -3,7 +3,7 @@
 #endif
 #include Ws2tcpip.h

-#if (_WIN32_WINNT = 0x500)
+#if (_WIN32_WINNT  0x0600)
 PHPAPI int inet_pton(int af, const char* src, void* dst);
 PHPAPI const char* inet_ntop(int af, const void* src, char* dst, size_t size);
 PHPAPI int inet_aton(const char *cp, struct in_addr *inp);

Modified: php/php-src/branches/PHP_5_4/win32/inet.h
===
--- php/php-src/branches/PHP_5_4/win32/inet.h   2012-03-05 20:14:55 UTC (rev 
323925)
+++ php/php-src/branches/PHP_5_4/win32/inet.h   2012-03-05 20:53:40 UTC (rev 
323926)
@@ -3,7 +3,7 @@
 #endif
 #include Ws2tcpip.h

-#if (_WIN32_WINNT = 0x502)
+#if (_WIN32_WINNT  0x0600)
 PHPAPI int inet_pton(int af, const char* src, void* dst);
 PHPAPI const char* inet_ntop(int af, const void* src, char* dst, size_t size);
 PHPAPI int inet_aton(const char *cp, struct in_addr *inp);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt branches/PHP_5_4/ext/pdo_mysql/mysql_statement.c branches/PHP_5_4/ext/

2012-03-05 Thread Johannes Schluuml;ter
johannes Mon, 05 Mar 2012 23:38:15 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323928

Log:
Fix Bug #61207 PDO::nextRowset() after a multi-statement query doesn't always 
work

Bug: https://bugs.php.net/61207 (Assigned) PDO::nextRowset() after a 
multi-statement query doesn't always work
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
A   php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/mysql_statement.c
A   php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/bug_61207.phpt
U   php/php-src/trunk/ext/pdo_mysql/mysql_statement.c
A   php/php-src/trunk/ext/pdo_mysql/tests/bug_61207.phpt

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c	2012-03-05 21:22:15 UTC (rev 323927)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_statement.c	2012-03-05 23:38:15 UTC (rev 323928)
@@ -131,6 +131,39 @@
 }
 /* }}} */

+static int pdo_mysql_fill_stmt_from_result(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+	pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt-driver_data;
+	pdo_mysql_db_handle *H = S-H;
+	my_ulonglong row_count;
+	PDO_DBG_ENTER(pdo_mysql_fill_stmt_from_result);
+
+	row_count = mysql_affected_rows(H-server);
+	if (row_count == (my_ulonglong)-1) {
+		/* we either have a query that returned a result set or an error occured
+		   lets see if we have access to a result set */
+		if (!H-buffered) {
+			S-result = mysql_use_result(H-server);
+		} else {
+			S-result = mysql_store_result(H-server);
+		}
+		if (NULL == S-result) {
+			pdo_mysql_error_stmt(stmt);
+			PDO_DBG_RETURN(0);
+		}
+
+		stmt-row_count = (long) mysql_num_rows(S-result);
+		stmt-column_count = (int) mysql_num_fields(S-result);
+		S-fields = mysql_fetch_fields(S-result);
+	} else {
+		/* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */
+		stmt-row_count = (long) row_count;
+	}
+
+	PDO_DBG_RETURN(1);
+}
+/* }}} */
+
 #ifdef HAVE_MYSQL_STMT_PREPARE
 static int pdo_mysql_stmt_execute_prepared_libmysql(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
 {
@@ -310,30 +343,7 @@
 		PDO_DBG_RETURN(0);
 	}

-	row_count = mysql_affected_rows(H-server);
-	if (row_count == (my_ulonglong)-1) {
-		/* we either have a query that returned a result set or an error occured
-		   lets see if we have access to a result set */
-		if (!H-buffered) {
-			S-result = mysql_use_result(H-server);
-		} else {
-			S-result = mysql_store_result(H-server);
-		}
-		if (NULL == S-result) {
-			pdo_mysql_error_stmt(stmt);
-			PDO_DBG_RETURN(0);
-		}
-
-		stmt-row_count = (long) mysql_num_rows(S-result);
-		stmt-column_count = (int) mysql_num_fields(S-result);
-		S-fields = mysql_fetch_fields(S-result);
-
-	} else {
-		/* this was a DML or DDL query (INSERT, UPDATE, DELETE, ... */
-		stmt-row_count = (long) row_count;
-	}
-
-	PDO_DBG_RETURN(1);
+	PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
 }
 /* }}} */

@@ -421,25 +431,7 @@
 		/* No more results */
 		PDO_DBG_RETURN(0);
 	} else {
-		if (!H-buffered) {
-			S-result = mysql_use_result(H-server);
-			row_count = 0;
-		} else {
-			S-result = mysql_store_result(H-server);
-			if ((long)-1 == (row_count = (long) mysql_affected_rows(H-server))) {
-pdo_mysql_error_stmt(stmt);
-PDO_DBG_RETURN(0);
-			}
-		}
-
-		if (NULL == S-result) {
-			PDO_DBG_RETURN(0);
-		}
-
-		stmt-row_count = row_count;
-		stmt-column_count = (int) mysql_num_fields(S-result);
-		S-fields = mysql_fetch_fields(S-result);
-		PDO_DBG_RETURN(1);
+		PDO_DBG_RETURN(pdo_mysql_fill_stmt_from_result(stmt TSRMLS_CC));
 	}
 #else
 	strcpy(stmt-error_code, HYC00);

Added: php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/bug_61207.phpt	2012-03-05 23:38:15 UTC (rev 323928)
@@ -0,0 +1,103 @@
+--TEST--
+PDO MySQL Bug #61207 (PDO::nextRowset() after a multi-statement query doesn't always work)
+--SKIPIF--
+?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
+require dirname(__FILE__) . '/config.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
+?
+--FILE--
+?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+
+$link = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$link-query('create table `bug61207`( `id` int )');
+
+$handle1 = $link-prepare('insert into bug61207(id) values(1);
+  select * from bug61207 where id = ?;
+  update bug61207 set id = 2 where id = ?;');
+
+$handle1-bindValue('1', '1');
+$handle1-bindValue('2', '1');
+

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h branches/

2012-03-05 Thread Johannes Schluuml;ter
johannes Mon, 05 Mar 2012 23:57:24 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323930

Log:
Fix bug #61194 PDO should export compression flag with myslqnd

Bug: https://bugs.php.net/61194 (Closed) PDO should export compression flag 
with myslqnd
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c
U   php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h
U   
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/mysql_driver.c
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/pdo_mysql.c
U   php/php-src/branches/PHP_5_4/ext/pdo_mysql/php_pdo_mysql_int.h
U   
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
U   php/php-src/trunk/ext/pdo_mysql/mysql_driver.c
U   php/php-src/trunk/ext/pdo_mysql/pdo_mysql.c
U   php/php-src/trunk/ext/pdo_mysql/php_pdo_mysql_int.h
U   php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-05 23:57:24 UTC (rev 323930)
@@ -36,6 +36,12 @@
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

+- PDO_mysql
+  . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
+always work). (Johannes)
+  . Fixed bug #61194 (PDO should export compression flag with myslqnd).
+(Johannes)
+
 - Phar:
   . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL bytes). (Nikic)


Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/mysql_driver.c	2012-03-05 23:57:24 UTC (rev 323930)
@@ -624,8 +624,8 @@
 		char *init_cmd = NULL;
 #ifndef PDO_USE_MYSQLND
 		char *default_file = NULL, *default_group = NULL;
-		long compress = 0;
 #endif
+		long compress = 0;
 #if defined(HAVE_MYSQL_STMT_PREPARE) || defined(PDO_USE_MYSQLND)
 		char *ssl_key = NULL, *ssl_cert = NULL, *ssl_ca = NULL, *ssl_capath = NULL, *ssl_cipher = NULL;
 #endif
@@ -706,7 +706,7 @@
 			}
 			efree(default_group);
 		}
-
+#endif
 		compress = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_COMPRESS, 0 TSRMLS_CC);
 		if (compress) {
 			if (mysql_options(H-server, MYSQL_OPT_COMPRESS, 0)) {
@@ -714,7 +714,6 @@
 goto cleanup;
 			}
 		}
-#endif
 #if defined(HAVE_MYSQL_STMT_PREPARE) || defined(PDO_USE_MYSQLND)
 		ssl_key = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_KEY, NULL TSRMLS_CC);
 		ssl_cert = pdo_attr_strval(driver_options, PDO_MYSQL_ATTR_SSL_CERT, NULL TSRMLS_CC);

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c	2012-03-05 23:57:24 UTC (rev 323930)
@@ -84,8 +84,8 @@
 	REGISTER_PDO_CLASS_CONST_LONG(MYSQL_ATTR_MAX_BUFFER_SIZE, (long)PDO_MYSQL_ATTR_MAX_BUFFER_SIZE);
 	REGISTER_PDO_CLASS_CONST_LONG(MYSQL_ATTR_READ_DEFAULT_FILE, (long)PDO_MYSQL_ATTR_READ_DEFAULT_FILE);
 	REGISTER_PDO_CLASS_CONST_LONG(MYSQL_ATTR_READ_DEFAULT_GROUP, (long)PDO_MYSQL_ATTR_READ_DEFAULT_GROUP);
+#endif
 	REGISTER_PDO_CLASS_CONST_LONG(MYSQL_ATTR_COMPRESS, (long)PDO_MYSQL_ATTR_COMPRESS);
-#endif
 	REGISTER_PDO_CLASS_CONST_LONG(MYSQL_ATTR_DIRECT_QUERY, (long)PDO_MYSQL_ATTR_DIRECT_QUERY);
 	REGISTER_PDO_CLASS_CONST_LONG(MYSQL_ATTR_FOUND_ROWS, (long)PDO_MYSQL_ATTR_FOUND_ROWS);
 	REGISTER_PDO_CLASS_CONST_LONG(MYSQL_ATTR_IGNORE_SPACE, (long)PDO_MYSQL_ATTR_IGNORE_SPACE);

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h
===
--- php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h	2012-03-05 23:55:12 UTC (rev 323929)
+++ php/php-src/branches/PHP_5_3/ext/pdo_mysql/php_pdo_mysql_int.h	2012-03-05 23:57:24 UTC (rev 323930)
@@ -163,8 +163,8 @@
 	PDO_MYSQL_ATTR_READ_DEFAULT_FILE,
 	PDO_MYSQL_ATTR_READ_DEFAULT_GROUP,
 	PDO_MYSQL_ATTR_MAX_BUFFER_SIZE,
+#endif
 	PDO_MYSQL_ATTR_COMPRESS,
-#endif
 	PDO_MYSQL_ATTR_DIRECT_QUERY,
 	PDO_MYSQL_ATTR_FOUND_ROWS,
 	PDO_MYSQL_ATTR_IGNORE_SPACE,

Modified: php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql_class_constants.phpt
===
--- 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/mysqli/mysqli_prop.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/mysqli/mysqli_prop.c trunk/ext/mysqli/mysqli_prop.c

2012-03-05 Thread Johannes Schluuml;ter
johannes Tue, 06 Mar 2012 00:15:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323931

Log:
Fix bug #61003 mysql_stat() require a valid connection

Bug: https://bugs.php.net/61003 (Assigned) mysql_stat() require a valid 
connection
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c
U   php/php-src/trunk/ext/mysqli/mysqli_prop.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-05 23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-06 00:15:40 UTC (rev 323931)
@@ -36,6 +36,9 @@
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

+- mysqli
+  . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).
+
 - PDO_mysql
   . Fixed bug #61207 (PDO::nextRowset() after a multi-statement query doesn't
 always work). (Johannes)

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c
===
--- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c   2012-03-05 
23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_prop.c   2012-03-06 
00:15:40 UTC (rev 323931)
@@ -211,7 +211,11 @@
MAKE_STD_ZVAL(*retval);
ZVAL_NULL(*retval);

+#if defined(MYSQLI_USE_MYSQLND)
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
+#else
+   CHECK_STATUS(MYSQLI_STATUS_VALID);
+#endif

mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;


Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-05 23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-06 00:15:40 UTC (rev 323931)
@@ -38,6 +38,9 @@
 - mbstring:
   . MFH mb_ereg_replace_callback() for security enhancements. (Rui)

+- mysqli
+  . Fixed bug #61003 (mysql_stat() require a valid connection). (Johannes).
+
 - mysqlnd
   . Fixed bug #60948 (mysqlnd FTBFS when -Wformat-security is enabled).
 (Johannes)

Modified: php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c
===
--- php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c   2012-03-05 
23:57:24 UTC (rev 323930)
+++ php/php-src/branches/PHP_5_4/ext/mysqli/mysqli_prop.c   2012-03-06 
00:15:40 UTC (rev 323931)
@@ -260,7 +260,11 @@
MAKE_STD_ZVAL(*retval);
ZVAL_NULL(*retval);

+#if defined(MYSQLI_USE_MYSQLND)
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
+#else
+   CHECK_STATUS(MYSQLI_STATUS_VALID);
+#endif

mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;


Modified: php/php-src/trunk/ext/mysqli/mysqli_prop.c
===
--- php/php-src/trunk/ext/mysqli/mysqli_prop.c  2012-03-05 23:57:24 UTC (rev 
323930)
+++ php/php-src/trunk/ext/mysqli/mysqli_prop.c  2012-03-06 00:15:40 UTC (rev 
323931)
@@ -260,7 +260,11 @@
MAKE_STD_ZVAL(*retval);
ZVAL_NULL(*retval);

+#if defined(MYSQLI_USE_MYSQLND)
CHECK_STATUS(MYSQLI_STATUS_INITIALIZED);
+#else
+   CHECK_STATUS(MYSQLI_STATUS_VALID);
+#endif

mysql = (MY_MYSQL *)((MYSQLI_RESOURCE *)(obj-ptr))-ptr;


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt trunk/ext

2012-03-05 Thread Johannes Schluuml;ter
johannes Tue, 06 Mar 2012 01:43:49 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323932

Log:
Apply test fix for bug #61288 pdo_mysql___construct_options_libmysql.phpt test 
fails

Bug: https://bugs.php.net/61288 (Open) 
pdo_mysql___construct_options_libmysql.phpt test fails
  
Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
U   
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
U   
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 00:15:40 UTC (rev 323931)
+++ 
php/php-src/branches/PHP_5_3/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 01:43:49 UTC (rev 323932)
@@ -4,6 +4,7 @@
 ?php
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+MySQLPDOTest::skip();
 if (MySQLPDOTest::isPDOMySQLnd())
die(skip libmysql only options)
 ?

Modified: 
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
===
--- 
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 00:15:40 UTC (rev 323931)
+++ 
php/php-src/branches/PHP_5_4/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
2012-03-06 01:43:49 UTC (rev 323932)
@@ -4,6 +4,7 @@
 ?php
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+MySQLPDOTest::skip();
 if (MySQLPDOTest::isPDOMySQLnd())
die(skip libmysql only options)
 ?

Modified: 
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
===
--- 
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
   2012-03-06 00:15:40 UTC (rev 323931)
+++ 
php/php-src/trunk/ext/pdo_mysql/tests/pdo_mysql___construct_options_libmysql.phpt
   2012-03-06 01:43:49 UTC (rev 323932)
@@ -4,6 +4,7 @@
 ?php
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+MySQLPDOTest::skip();
 if (MySQLPDOTest::isPDOMySQLnd())
die(skip libmysql only options)
 ?

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/spl/spl_engine.c branches/PHP_5_4/ext/spl/spl_engine.c trunk/ext/spl/spl_engine.c

2012-03-04 Thread Nikita Popov
nikicSun, 04 Mar 2012 13:52:48 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323863

Log:
Fix bug #60596: Code Cleanup Removing Superfluous If Statement

Cleanup only, no function change. Patch by ircmaxell.

Bug: https://bugs.php.net/60596 (Open) Code Cleanup Removing Superfluous If 
Statement
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/spl/spl_engine.c
U   php/php-src/branches/PHP_5_4/ext/spl/spl_engine.c
U   php/php-src/trunk/ext/spl/spl_engine.c

Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_engine.c
===
--- php/php-src/branches/PHP_5_3/ext/spl/spl_engine.c   2012-03-04 13:39:12 UTC 
(rev 323862)
+++ php/php-src/branches/PHP_5_3/ext/spl/spl_engine.c   2012-03-04 13:52:48 UTC 
(rev 323863)
@@ -45,19 +45,16 @@

 PHPAPI long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */
 {
-   switch(Z_TYPE_P(offset)) {
+   switch (Z_TYPE_P(offset)) {
case IS_STRING:
ZEND_HANDLE_NUMERIC(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, 
idx);
break;
case IS_DOUBLE:
+   return (long)Z_DVAL_P(offset);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
-   if (Z_TYPE_P(offset) == IS_DOUBLE) {
-   return (long)Z_DVAL_P(offset);
-   } else {
-   return Z_LVAL_P(offset);
-   }
+   return Z_LVAL_P(offset);
}
return -1;
 }

Modified: php/php-src/branches/PHP_5_4/ext/spl/spl_engine.c
===
--- php/php-src/branches/PHP_5_4/ext/spl/spl_engine.c   2012-03-04 13:39:12 UTC 
(rev 323862)
+++ php/php-src/branches/PHP_5_4/ext/spl/spl_engine.c   2012-03-04 13:52:48 UTC 
(rev 323863)
@@ -45,19 +45,16 @@

 PHPAPI long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */
 {
-   switch(Z_TYPE_P(offset)) {
+   switch (Z_TYPE_P(offset)) {
case IS_STRING:
ZEND_HANDLE_NUMERIC(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, 
idx);
break;
case IS_DOUBLE:
+   return (long)Z_DVAL_P(offset);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
-   if (Z_TYPE_P(offset) == IS_DOUBLE) {
-   return (long)Z_DVAL_P(offset);
-   } else {
-   return Z_LVAL_P(offset);
-   }
+   return Z_LVAL_P(offset);
}
return -1;
 }

Modified: php/php-src/trunk/ext/spl/spl_engine.c
===
--- php/php-src/trunk/ext/spl/spl_engine.c  2012-03-04 13:39:12 UTC (rev 
323862)
+++ php/php-src/trunk/ext/spl/spl_engine.c  2012-03-04 13:52:48 UTC (rev 
323863)
@@ -45,19 +45,16 @@

 PHPAPI long spl_offset_convert_to_long(zval *offset TSRMLS_DC) /* {{{ */
 {
-   switch(Z_TYPE_P(offset)) {
+   switch (Z_TYPE_P(offset)) {
case IS_STRING:
ZEND_HANDLE_NUMERIC(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, 
idx);
break;
case IS_DOUBLE:
+   return (long)Z_DVAL_P(offset);
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
-   if (Z_TYPE_P(offset) == IS_DOUBLE) {
-   return (long)Z_DVAL_P(offset);
-   } else {
-   return Z_LVAL_P(offset);
-   }
+   return Z_LVAL_P(offset);
}
return -1;
 }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/xp_socket.c branches/PHP_5_4/main/streams/xp_socket.c trunk/main/streams/xp_socket.c

2012-03-04 Thread Gustavo André dos Santos Lopes
cataphract   Sun, 04 Mar 2012 19:30:01 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323897

Log:
- size_t may be shorter than long and definitely is not signed. Note that the
  z modifier was only added in C99, so we can't use it.

Changed paths:
U   php/php-src/branches/PHP_5_3/main/streams/xp_socket.c
U   php/php-src/branches/PHP_5_4/main/streams/xp_socket.c
U   php/php-src/trunk/main/streams/xp_socket.c

Modified: php/php-src/branches/PHP_5_3/main/streams/xp_socket.c
===
--- php/php-src/branches/PHP_5_3/main/streams/xp_socket.c   2012-03-04 
19:17:49 UTC (rev 323896)
+++ php/php-src/branches/PHP_5_3/main/streams/xp_socket.c   2012-03-04 
19:30:01 UTC (rev 323897)
@@ -514,7 +514,9 @@
 * BUT, to get into this branch of code, the name is too long,
 * so we don't care. */
xparam-inputs.namelen = sizeof(unix_addr-sun_path) - 1;
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, socket path 
exceeded the maximum allowed length of %ld bytes and was truncated, 
sizeof(unix_addr-sun_path));
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+   socket path exceeded the maximum allowed length of %lu 
bytes 
+   and was truncated, (unsigned 
long)sizeof(unix_addr-sun_path));
}

memcpy(unix_addr-sun_path, xparam-inputs.name, 
xparam-inputs.namelen);

Modified: php/php-src/branches/PHP_5_4/main/streams/xp_socket.c
===
--- php/php-src/branches/PHP_5_4/main/streams/xp_socket.c   2012-03-04 
19:17:49 UTC (rev 323896)
+++ php/php-src/branches/PHP_5_4/main/streams/xp_socket.c   2012-03-04 
19:30:01 UTC (rev 323897)
@@ -510,7 +510,9 @@
 * BUT, to get into this branch of code, the name is too long,
 * so we don't care. */
xparam-inputs.namelen = sizeof(unix_addr-sun_path) - 1;
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, socket path 
exceeded the maximum allowed length of %ld bytes and was truncated, 
sizeof(unix_addr-sun_path));
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+   socket path exceeded the maximum allowed length of %lu 
bytes 
+   and was truncated, (unsigned 
long)sizeof(unix_addr-sun_path));
}

memcpy(unix_addr-sun_path, xparam-inputs.name, 
xparam-inputs.namelen);

Modified: php/php-src/trunk/main/streams/xp_socket.c
===
--- php/php-src/trunk/main/streams/xp_socket.c  2012-03-04 19:17:49 UTC (rev 
323896)
+++ php/php-src/trunk/main/streams/xp_socket.c  2012-03-04 19:30:01 UTC (rev 
323897)
@@ -510,7 +510,9 @@
 * BUT, to get into this branch of code, the name is too long,
 * so we don't care. */
xparam-inputs.namelen = sizeof(unix_addr-sun_path) - 1;
-   php_error_docref(NULL TSRMLS_CC, E_NOTICE, socket path 
exceeded the maximum allowed length of %ld bytes and was truncated, 
sizeof(unix_addr-sun_path));
+   php_error_docref(NULL TSRMLS_CC, E_NOTICE,
+   socket path exceeded the maximum allowed length of %lu 
bytes 
+   and was truncated, (unsigned 
long)sizeof(unix_addr-sun_path));
}

memcpy(unix_addr-sun_path, xparam-inputs.name, 
xparam-inputs.namelen);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt branches/PHP_5_3/main/streams/xp_socket.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/st

2012-03-04 Thread Ilia Alshanetsky
The operation can continue on-successfully so E_NOTICE seemed
appropriate, I don't see a problem with escalating this to E_WARNING.

On Sat, Mar 3, 2012 at 9:34 PM, Laruence larue...@php.net wrote:
 Hi:
   is a WARNING better?  :)

 thanks

 On Sun, Mar 4, 2012 at 4:36 AM, Ilia Alshanetsky il...@php.net wrote:
 iliaa                                    Sat, 03 Mar 2012 20:36:14 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323852

 Log:
 Fixed bug #60106 (stream_socket_server silently truncates long unix socket 
 paths)

 Bug: https://bugs.php.net/60106 (Open) stream_socket_server + long unix 
 socket path = 'Unknown error'

 Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    A   php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt
    U   php/php-src/branches/PHP_5_3/main/streams/xp_socket.c
    U   php/php-src/branches/PHP_5_4/NEWS
    A   php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug60106.phpt
    U   php/php-src/branches/PHP_5_4/main/streams/xp_socket.c
    A   php/php-src/trunk/ext/standard/tests/streams/bug60106.phpt
    U   php/php-src/trunk/main/streams/xp_socket.c


 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



 --
 Laruence  Xinchen Hui
 http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/win32/build/config.w32.h.in PHP_5_4/win32/build/config.w32.h.in

2012-03-04 Thread Pierre Joye
pajoye   Sun, 04 Mar 2012 22:15:12 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323903

Log:
- fix bug #54407, Incorrectly defined NTDDI_VERSION macro

Bug: https://bugs.php.net/54407 (Closed) Incorrectly defined NTDDI_VERSION 
macro 
  
Changed paths:
U   php/php-src/branches/PHP_5_3/win32/build/config.w32.h.in
U   php/php-src/branches/PHP_5_4/win32/build/config.w32.h.in

Modified: php/php-src/branches/PHP_5_3/win32/build/config.w32.h.in
===
--- php/php-src/branches/PHP_5_3/win32/build/config.w32.h.in2012-03-04 
20:37:28 UTC (rev 323902)
+++ php/php-src/branches/PHP_5_3/win32/build/config.w32.h.in2012-03-04 
22:15:12 UTC (rev 323903)
@@ -6,7 +6,7 @@
 /* Define the minimum supported version */
 #undef _WIN32_WINNT
 #undef NTDDI_VERSION
-#define _WIN32_WINNT 0x502
+#define _WIN32_WINNT 0x0501
 #define NTDDI_VERSION  0x05010200

 /* Default PHP / PEAR directories */

Modified: php/php-src/branches/PHP_5_4/win32/build/config.w32.h.in
===
--- php/php-src/branches/PHP_5_4/win32/build/config.w32.h.in2012-03-04 
20:37:28 UTC (rev 323902)
+++ php/php-src/branches/PHP_5_4/win32/build/config.w32.h.in2012-03-04 
22:15:12 UTC (rev 323903)
@@ -6,7 +6,7 @@
 /* Define the minimum supported version */
 #undef _WIN32_WINNT
 #undef NTDDI_VERSION
-#define _WIN32_WINNT 0x502
+#define _WIN32_WINNT 0x0501
 #define NTDDI_VERSION  0x05010200

 /* Default PHP / PEAR directories */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/xmlrpc/tests/bug61264.phpt branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/xmlrpc/tests/

2012-03-03 Thread Nikita Popov
nikicSat, 03 Mar 2012 12:46:17 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323850

Log:
Fix bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable

Bug: https://bugs.php.net/61264 (Open) xmlrpc_parse_method_descriptions leaks 
temporary variable
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61264.phpt
U   php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c
U   php/php-src/branches/PHP_5_4/NEWS
A   php/php-src/branches/PHP_5_4/ext/xmlrpc/tests/bug61264.phpt
U   php/php-src/branches/PHP_5_4/ext/xmlrpc/xmlrpc-epi-php.c
A   php/php-src/trunk/ext/xmlrpc/tests/bug61264.phpt
U   php/php-src/trunk/ext/xmlrpc/xmlrpc-epi-php.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-02 23:07:19 UTC (rev 323849)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-03 12:46:17 UTC (rev 323850)
@@ -73,6 +73,7 @@

 - XMLRPC:
   . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)
+  . Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary 
variable). (Nikita Popov)

 - Zlib:
   . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikic)

Added: php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61264.phpt
===
--- php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61264.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61264.phpt 2012-03-03 
12:46:17 UTC (rev 323850)
@@ -0,0 +1,17 @@
+--TEST--
+Bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable
+--FILE--
+?php
+$xml = XML
+?xml version=1.0 encoding=utf-8?
+a
+ bfoo/b
+/a
+XML;
+var_dump(xmlrpc_parse_method_descriptions($xml));
+?
+--EXPECT--
+array(1) {
+  [b]=
+  string(3) foo
+}

Modified: php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c
===
--- php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c2012-03-02 
23:07:19 UTC (rev 323849)
+++ php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c2012-03-03 
12:46:17 UTC (rev 323850)
@@ -1240,8 +1240,7 @@
retval = XMLRPC_to_PHP(xVal);

if (retval) {
-   *return_value = *retval;
-   zval_copy_ctor(return_value);
+   RETVAL_ZVAL(retval, 1, 1);
}
/* dust, sweep, and mop */
XMLRPC_CleanupValue(xVal);

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-02 23:07:19 UTC (rev 323849)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-03 12:46:17 UTC (rev 323850)
@@ -48,6 +48,7 @@

 - XMLRPC:
   . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikita 
Popov)
+  . Fixed bug #61264 (xmlrpc_parse_method_descriptions leaks temporary 
variable). (Nikita Popov)

 - Zlib:
   . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikita 
Popov)

Added: php/php-src/branches/PHP_5_4/ext/xmlrpc/tests/bug61264.phpt
===
--- php/php-src/branches/PHP_5_4/ext/xmlrpc/tests/bug61264.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/xmlrpc/tests/bug61264.phpt 2012-03-03 
12:46:17 UTC (rev 323850)
@@ -0,0 +1,17 @@
+--TEST--
+Bug #61264: xmlrpc_parse_method_descriptions leaks temporary variable
+--FILE--
+?php
+$xml = XML
+?xml version=1.0 encoding=utf-8?
+a
+ bfoo/b
+/a
+XML;
+var_dump(xmlrpc_parse_method_descriptions($xml));
+?
+--EXPECT--
+array(1) {
+  [b]=
+  string(3) foo
+}

Modified: php/php-src/branches/PHP_5_4/ext/xmlrpc/xmlrpc-epi-php.c
===
--- php/php-src/branches/PHP_5_4/ext/xmlrpc/xmlrpc-epi-php.c2012-03-02 
23:07:19 UTC (rev 323849)
+++ php/php-src/branches/PHP_5_4/ext/xmlrpc/xmlrpc-epi-php.c2012-03-03 
12:46:17 UTC (rev 323850)
@@ -1240,8 +1240,7 @@
retval = XMLRPC_to_PHP(xVal);

if (retval) {
-   *return_value = *retval;
-   zval_copy_ctor(return_value);
+   RETVAL_ZVAL(retval, 1, 1);
}
/* dust, sweep, and mop */
XMLRPC_CleanupValue(xVal);

Added: php/php-src/trunk/ext/xmlrpc/tests/bug61264.phpt
===
--- php/php-src/trunk/ext/xmlrpc/tests/bug61264.phpt
(rev 0)
+++ php/php-src/trunk/ext/xmlrpc/tests/bug61264.phpt2012-03-03 12:46:17 UTC 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt branches/PHP_5_3/main/streams/xp_socket.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/standa

2012-03-03 Thread Ilia Alshanetsky
iliaaSat, 03 Mar 2012 20:36:14 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323852

Log:
Fixed bug #60106 (stream_socket_server silently truncates long unix socket 
paths)

Bug: https://bugs.php.net/60106 (Open) stream_socket_server + long unix socket 
path = 'Unknown error'
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt
U   php/php-src/branches/PHP_5_3/main/streams/xp_socket.c
U   php/php-src/branches/PHP_5_4/NEWS
A   php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug60106.phpt
U   php/php-src/branches/PHP_5_4/main/streams/xp_socket.c
A   php/php-src/trunk/ext/standard/tests/streams/bug60106.phpt
U   php/php-src/trunk/main/streams/xp_socket.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-03 15:08:21 UTC (rev 323851)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-03 20:36:14 UTC (rev 323852)
@@ -62,6 +62,8 @@
 - Streams:
   . Fixed bug #61115 (stream related segfault on fatal error in
 php_stream_context_link). (Gustavo)
+  . Fixed bug #60106 (stream_socket_server silently truncates long unix
+socket paths). (Ilia)
   . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not
 detected together with the last read). (Gustavo)
   . Fixed bug #60817 (stream_get_line() reads from stream even when there is

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt	2012-03-03 20:36:14 UTC (rev 323852)
@@ -0,0 +1,14 @@
+--TEST--
+Bug#60106 (stream_socket_server silently truncates long unix socket paths)
+--FILE--
+?php
+	error_reporting(E_ALL | E_NOTICE);
+	stream_socket_server(unix:///tmp/ . str_repeat(a, 4096));
+?
+===DONE===
+--EXPECTF--
+Notice: stream_socket_server(): socket path exceeded the maximum allowed length of %d bytes and was truncated in %s on line %d
+
+Warning: stream_socket_server(): unable to connect to unix:///tmp/aaa in %s on line %d
+===DONE===
+

Modified: php/php-src/branches/PHP_5_3/main/streams/xp_socket.c
===
--- php/php-src/branches/PHP_5_3/main/streams/xp_socket.c	2012-03-03 15:08:21 UTC (rev 323851)
+++ php/php-src/branches/PHP_5_3/main/streams/xp_socket.c	2012-03-03 20:36:14 UTC (rev 323852)
@@ -514,6 +514,7 @@
 		 * BUT, to get into this branch of code, the name is too long,
 		 * so we don't care. */
 		xparam-inputs.namelen = sizeof(unix_addr-sun_path) - 1;
+		php_error_docref(NULL TSRMLS_CC, E_NOTICE, socket path exceeded the maximum allowed length of %ld bytes and was truncated, sizeof(unix_addr-sun_path));
 	}

 	memcpy(unix_addr-sun_path, xparam-inputs.name, xparam-inputs.namelen);

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS	2012-03-03 15:08:21 UTC (rev 323851)
+++ php/php-src/branches/PHP_5_4/NEWS	2012-03-03 20:36:14 UTC (rev 323852)
@@ -45,6 +45,7 @@
 - Standard:
   . Fixed memory leak in substr_replace. (Pierrick)
   . Make max_file_uploads ini directive settable outside of php.ini (Rasmus)
+  . Fixed bug #60106 (stream_socket_server silently truncates long unix socket paths). (Ilia)

 - XMLRPC:
   . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikita Popov)

Added: php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug60106.phpt
===
--- php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug60106.phpt	(rev 0)
+++ 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt branches/PHP_5_3/main/streams/xp_socket.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/st

2012-03-03 Thread Laruence
Hi:
   is a WARNING better?  :)

thanks

On Sun, Mar 4, 2012 at 4:36 AM, Ilia Alshanetsky il...@php.net wrote:
 iliaa                                    Sat, 03 Mar 2012 20:36:14 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323852

 Log:
 Fixed bug #60106 (stream_socket_server silently truncates long unix socket 
 paths)

 Bug: https://bugs.php.net/60106 (Open) stream_socket_server + long unix 
 socket path = 'Unknown error'

 Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    A   php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug60106.phpt
    U   php/php-src/branches/PHP_5_3/main/streams/xp_socket.c
    U   php/php-src/branches/PHP_5_4/NEWS
    A   php/php-src/branches/PHP_5_4/ext/standard/tests/streams/bug60106.phpt
    U   php/php-src/branches/PHP_5_4/main/streams/xp_socket.c
    A   php/php-src/trunk/ext/standard/tests/streams/bug60106.phpt
    U   php/php-src/trunk/main/streams/xp_socket.c


 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/date/tests/ bug20382-2.phpt

2012-03-02 Thread Rasmus Lerdorf
rasmus   Fri, 02 Mar 2012 17:08:00 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323834

Log:
Missed 5.3 for the Armenia DST drop

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/tests/bug20382-2.phpt

Modified: php/php-src/branches/PHP_5_3/ext/date/tests/bug20382-2.phpt
===
--- php/php-src/branches/PHP_5_3/ext/date/tests/bug20382-2.phpt 2012-03-02 
17:06:53 UTC (rev 323833)
+++ php/php-src/branches/PHP_5_3/ext/date/tests/bug20382-2.phpt 2012-03-02 
17:08:00 UTC (rev 323834)
@@ -75,7 +75,7 @@
 wanted = Monday00:00:00

 Asia/Yerevan
-ts = Monday 2037-10-19 17:17:17 AMST
+ts = Monday 2037-10-19 17:17:17 AMT
 result = Monday 2037-10-26 00:00:00 AMT
 wanted = Monday00:00:00


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/array.c branches/PHP_5_3/ext/standard/tests/array/bug52719.phpt branches/PHP_5_4/NEWS branches/PHP_5_4/ext/standard/arr

2012-03-02 Thread Nikita Popov
nikicFri, 02 Mar 2012 18:05:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323837

Log:
Fix bug #52719: array_walk_recursive crashes if third param of the function is 
by reference

Bug: https://bugs.php.net/52719 (Re-Opened) array_walk_recursive crashes if 
third param of the function is by reference 
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/standard/array.c
A   php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug52719.phpt
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/standard/array.c
A   php/php-src/branches/PHP_5_4/ext/standard/tests/array/bug52719.phpt
U   php/php-src/trunk/ext/standard/array.c
A   php/php-src/trunk/ext/standard/tests/array/bug52719.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-02 17:15:10 UTC (rev 323836)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-02 18:05:38 UTC (rev 323837)
@@ -2,6 +2,10 @@
 |||
 ?? ??? 2012, PHP 5.3.11

+- Array:
+  . Fixed bug #52719 (array_walk_recursive crashes if third param of the
+function is by reference). (Nikita Popov)
+
 - Core:
   . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).

Modified: php/php-src/branches/PHP_5_3/ext/standard/array.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/array.c	2012-03-02 17:15:10 UTC (rev 323836)
+++ php/php-src/branches/PHP_5_3/ext/standard/array.c	2012-03-02 18:05:38 UTC (rev 323837)
@@ -1044,7 +1044,7 @@
 }
 /* }}} */

-static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive TSRMLS_DC) /* {{{ */
+static int php_array_walk(HashTable *target_hash, zval *userdata, int recursive TSRMLS_DC) /* {{{ */
 {
 	zval **args[3],			/* Arguments to userland function */
 		  *retval_ptr,		/* Return value - unused */
@@ -1056,9 +1056,9 @@

 	/* Set up known arguments */
 	args[1] = key;
-	args[2] = userdata;
+	args[2] = userdata;
 	if (userdata) {
-		Z_ADDREF_PP(userdata);
+		Z_ADDREF_P(userdata);
 	}

 	zend_hash_internal_pointer_reset_ex(target_hash, pos);
@@ -1080,7 +1080,7 @@
 			if (thash-nApplyCount  1) {
 php_error_docref(NULL TSRMLS_CC, E_WARNING, recursion detected);
 if (userdata) {
-	zval_ptr_dtor(userdata);
+	zval_ptr_dtor(userdata);
 }
 return 0;
 			}
@@ -1133,7 +1133,7 @@
 	}

 	if (userdata) {
-		zval_ptr_dtor(userdata);
+		zval_ptr_dtor(userdata);
 	}
 	return 0;
 }
@@ -1157,7 +1157,7 @@
 		return;
 	}

-	php_array_walk(array, userdata ? userdata : NULL, 0 TSRMLS_CC);
+	php_array_walk(array, userdata, 0 TSRMLS_CC);
 	BG(array_walk_fci) = orig_array_walk_fci;
 	BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
 	RETURN_TRUE;
@@ -1182,7 +1182,7 @@
 		return;
 	}

-	php_array_walk(array, userdata ? userdata : NULL, 1 TSRMLS_CC);
+	php_array_walk(array, userdata, 1 TSRMLS_CC);
 	BG(array_walk_fci) = orig_array_walk_fci;
 	BG(array_walk_fci_cache) = orig_array_walk_fci_cache;
 	RETURN_TRUE;

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug52719.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug52719.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug52719.phpt	2012-03-02 18:05:38 UTC (rev 323837)
@@ -0,0 +1,15 @@
+--TEST--
+Bug #52719: array_walk_recursive crashes if third param of the function is by reference
+--FILE--
+?php
+$array = array(hello, array(world));
+$userdata = array();
+array_walk_recursive(
+$array,
+function ($value, $key, $userdata) { },
+$userdata
+);
+echo Done;
+?
+--EXPECTF--
+Done

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS	2012-03-02 17:15:10 UTC (rev 323836)
+++ php/php-src/branches/PHP_5_4/NEWS	2012-03-02 18:05:38 UTC (rev 323837)
@@ -3,6 +3,8 @@
 ?? ??? 2012, PHP 5.4.1 RC1

 - Array:
+  . Fixed bug #52719 (array_walk_recursive crashes if third param of the
+function is by reference). (Nikita Popov)
   . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
 (Laruence)


Modified: php/php-src/branches/PHP_5_4/ext/standard/array.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/array.c	2012-03-02 17:15:10 UTC (rev 323836)
+++ php/php-src/branches/PHP_5_4/ext/standard/array.c	2012-03-02 18:05:38 UTC (rev 323837)
@@ -1050,7 +1050,7 @@
 }
 /* }}} */

-static int php_array_walk(HashTable *target_hash, zval **userdata, int recursive TSRMLS_DC) /* {{{ */
+static int 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/timezonedb.h branches/PHP_5_4/ext/date/lib/timezonedb.h trunk/ext/date/lib/timezonedb.h

2012-03-01 Thread Derick Rethans
derick   Thu, 01 Mar 2012 15:09:49 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323706

Log:
- Updated to version 2012.1 (2012a)

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/date/lib/timezonedb.h
U   php/php-src/branches/PHP_5_4/ext/date/lib/timezonedb.h
U   php/php-src/trunk/ext/date/lib/timezonedb.h

diffs exceeded maximum size
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ php.ini-development php.ini-production

2012-03-01 Thread Christopher Jones
sixd Thu, 01 Mar 2012 20:05:18 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323729

Log:
Change PHP 6 refs to PHP 5.4 and sync some spelling with PHP_5_4 branch files

Changed paths:
U   php/php-src/branches/PHP_5_3/php.ini-development
U   php/php-src/branches/PHP_5_3/php.ini-production

Modified: php/php-src/branches/PHP_5_3/php.ini-development
===
--- php/php-src/branches/PHP_5_3/php.ini-development2012-03-01 20:02:57 UTC 
(rev 323728)
+++ php/php-src/branches/PHP_5_3/php.ini-development2012-03-01 20:05:18 UTC 
(rev 323729)
@@ -484,7 +484,7 @@
 ; development and early testing.
 ;
 ; Error Level Constants:
-; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
6.0.0)
+; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
5.4.0)
 ; E_ERROR   - fatal run-time errors
 ; E_RECOVERABLE_ERROR  - almost fatal run-time errors
 ; E_WARNING - run-time warnings (non-fatal errors)
@@ -748,7 +748,7 @@
 ; enable the feature. We strongly recommend you use the escaping mechanisms
 ; designed specifically for the database your using instead of relying on this
 ; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is
-; scheduled for removal in PHP 6.
+; removed in PHP 5.4.
 ; Default Value: On
 ; Development Value: Off
 ; Production Value: Off
@@ -1497,7 +1497,7 @@
 ;session.cookie_secure =

 ; This option forces PHP to fetch and use a cookie for storing and maintaining
-; the session id. We encourage this operation as it's very helpful in 
combatting
+; the session id. We encourage this operation as it's very helpful in combating
 ; session hijacking when not specifying and managing your own session id. It is
 ; not the end all be all of session hijacking defense, but it's a good start.
 ; http://php.net/session.use-only-cookies
@@ -1627,7 +1627,7 @@
 ; - User may send URL contains active session ID
 ;   to other person via. email/irc/etc.
 ; - URL that contains active session ID may be stored
-;   in publically accessible computer.
+;   in publicly accessible computer.
 ; - User may access your site with the same session ID
 ;   always using URL stored in browser's history or bookmarks.
 ; http://php.net/session.use-trans-sid

Modified: php/php-src/branches/PHP_5_3/php.ini-production
===
--- php/php-src/branches/PHP_5_3/php.ini-production 2012-03-01 20:02:57 UTC 
(rev 323728)
+++ php/php-src/branches/PHP_5_3/php.ini-production 2012-03-01 20:05:18 UTC 
(rev 323729)
@@ -484,7 +484,7 @@
 ; development and early testing.
 ;
 ; Error Level Constants:
-; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
6.0.0)
+; E_ALL - All errors and warnings (includes E_STRICT as of PHP 
5.4.0)
 ; E_ERROR   - fatal run-time errors
 ; E_RECOVERABLE_ERROR  - almost fatal run-time errors
 ; E_WARNING - run-time warnings (non-fatal errors)
@@ -748,7 +748,7 @@
 ; enable the feature. We strongly recommend you use the escaping mechanisms
 ; designed specifically for the database your using instead of relying on this
 ; feature. Also note, this feature has been deprecated as of PHP 5.3.0 and is
-; scheduled for removal in PHP 6.
+; scheduled removed in PHP 5.4.
 ; Default Value: On
 ; Development Value: Off
 ; Production Value: Off
@@ -1497,7 +1497,7 @@
 ;session.cookie_secure =

 ; This option forces PHP to fetch and use a cookie for storing and maintaining
-; the session id. We encourage this operation as it's very helpful in 
combatting
+; the session id. We encourage this operation as it's very helpful in combating
 ; session hijacking when not specifying and managing your own session id. It is
 ; not the end all be all of session hijacking defense, but it's a good start.
 ; http://php.net/session.use-only-cookies
@@ -1627,7 +1627,7 @@
 ; - User may send URL contains active session ID
 ;   to other person via. email/irc/etc.
 ; - URL that contains active session ID may be stored
-;   in publically accessible computer.
+;   in publicly accessible computer.
 ; - User may access your site with the same session ID
 ;   always using URL stored in browser's history or bookmarks.
 ; http://php.net/session.use-trans-sid

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/configure.in branches/PHP_5_3/sapi/apache2filter/config.m4 branches/PHP_5_3/sapi/apache2handler/config.m4 branches/PHP_5_4/NEWS bran

2012-03-01 Thread Christopher Jones
sixd Fri, 02 Mar 2012 00:07:41 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323750

Log:
Fixed bug #61172 (Add Apache 2.4 support)

Bug: https://bugs.php.net/61172 (Open) With Apache 2.4.1, ./configure fails on 
APXS but stops only on the MySQL check.
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/configure.in
U   php/php-src/branches/PHP_5_3/sapi/apache2filter/config.m4
U   php/php-src/branches/PHP_5_3/sapi/apache2handler/config.m4
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/configure.in
U   php/php-src/branches/PHP_5_4/sapi/apache2filter/config.m4
U   php/php-src/branches/PHP_5_4/sapi/apache2handler/config.m4
U   php/php-src/trunk/configure.in
U   php/php-src/trunk/sapi/apache2filter/config.m4
U   php/php-src/trunk/sapi/apache2handler/config.m4

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-03-01 23:58:16 UTC (rev 323749)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-03-02 00:07:41 UTC (rev 323750)
@@ -22,6 +22,9 @@
 (rui, Gustavo)
   . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)

+- Installation
+  . Fixed bug #61172 (Add Apache 2.4 support). (Chris Jones)
+
 - Fileinfo
   . Fixed bug #61173 (Unable to detect error from finfo constructor). (Gustavo)


Modified: php/php-src/branches/PHP_5_3/configure.in
===
--- php/php-src/branches/PHP_5_3/configure.in	2012-03-01 23:58:16 UTC (rev 323749)
+++ php/php-src/branches/PHP_5_3/configure.in	2012-03-02 00:07:41 UTC (rev 323750)
@@ -1550,6 +1550,21 @@
 X
   fi

+  if test $PHP_SAPI = apache2handler || test $PHP_SAPI = apache2filter; then
+if test $APACHE_VERSION -ge 2004001; then
+  if test -z $APACHE_THREADED_MPM; then
+cat X
+++
+|*** WARNING *** |
+||
+| You have built PHP for Apache's current non-threaded MPM.  |
+| If you change Apache to use a threaded MPM you must reconfigure|
+| PHP with --enable-maintainer-zts   |
+X
+  fi
+fi
+  fi
+
   # Warn about linking Apache with libpthread if oci8 extension is enabled on linux.
   if test $PHP_OCI8 != no; then
 if test $PHP_SAPI = apache; then

Modified: php/php-src/branches/PHP_5_3/sapi/apache2filter/config.m4
===
--- php/php-src/branches/PHP_5_3/sapi/apache2filter/config.m4	2012-03-01 23:58:16 UTC (rev 323749)
+++ php/php-src/branches/PHP_5_3/sapi/apache2filter/config.m4	2012-03-02 00:07:41 UTC (rev 323750)
@@ -39,7 +39,6 @@
   APXS_BINDIR=`$APXS -q BINDIR`
   APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
   APXS_CFLAGS=`$APXS -q CFLAGS`
-  APXS_MPM=`$APXS -q MPM_NAME`
   APU_BINDIR=`$APXS -q APU_BINDIR`
   APR_BINDIR=`$APXS -q APR_BINDIR`

@@ -118,8 +117,16 @@
 ;;
   esac

-  if test $APXS_MPM != prefork  test $APXS_MPM != peruser; then
-PHP_BUILD_THREAD_SAFE
+  if test $APACHE_VERSION -lt 2004001; then
+APXS_MPM=`$APXS -q MPM_NAME`
+if test $APXS_MPM != prefork  test $APXS_MPM != peruser  test $APXS_MPM != itk; then
+  PHP_BUILD_THREAD_SAFE
+fi
+  else
+APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
+if test -n $APACHE_THREADED_MPM; then
+  PHP_BUILD_THREAD_SAFE
+fi
   fi
   AC_MSG_RESULT(yes)
   PHP_SUBST(APXS)

Modified: php/php-src/branches/PHP_5_3/sapi/apache2handler/config.m4
===
--- php/php-src/branches/PHP_5_3/sapi/apache2handler/config.m4	2012-03-01 23:58:16 UTC (rev 323749)
+++ php/php-src/branches/PHP_5_3/sapi/apache2handler/config.m4	2012-03-02 00:07:41 UTC (rev 323750)
@@ -38,7 +38,6 @@
   APXS_BINDIR=`$APXS -q BINDIR`
   APXS_HTTPD=`$APXS -q SBINDIR`/`$APXS -q TARGET`
   APXS_CFLAGS=`$APXS -q CFLAGS`
-  APXS_MPM=`$APXS -q MPM_NAME`
   APU_BINDIR=`$APXS -q APU_BINDIR`
   APR_BINDIR=`$APXS -q APR_BINDIR`

@@ -117,8 +116,16 @@
 ;;
   esac

-  if test $APXS_MPM != prefork  test $APXS_MPM != peruser  test $APXS_MPM != itk; then
-PHP_BUILD_THREAD_SAFE
+  if test $APACHE_VERSION -lt 2004001; then
+APXS_MPM=`$APXS -q MPM_NAME`
+if test $APXS_MPM != prefork  test $APXS_MPM != peruser  test $APXS_MPM != itk; then
+  PHP_BUILD_THREAD_SAFE
+fi
+  else
+APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
+if test -n $APACHE_THREADED_MPM; then
+  PHP_BUILD_THREAD_SAFE
+fi
   fi
   AC_MSG_RESULT(yes)
   PHP_SUBST(APXS)

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS	

[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/NEWS PHP_5_3/ext/standard/string.c PHP_5_3/ext/standard/tests/strings/bug60801.phpt PHP_5_4/NEWS PHP_5_4/ext/standard/string.c PHP_5_4/ext/standard/tests/

2012-03-01 Thread Adam Harvey
aharvey  Fri, 02 Mar 2012 03:39:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323779

Log:
MFH: Fix bug #60801 (strpbrk() mishandles NUL byte). (Trunk commit: r322934).

Bug: https://bugs.php.net/60801 (Closed) strpbrk() mishandles NUL byte
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/standard/string.c
A   php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug60801.phpt
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/standard/string.c
A   php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60801.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-03-02 03:38:04 UTC (rev 323778)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-03-02 03:39:04 UTC (rev 323779)
@@ -18,6 +18,7 @@
 functions). (Pierre)
   . Fixed bug #60825 (Segfault when running symfony 2 tests).
 (Dmitry, Laruence)
+  . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam)
   . Fixed bug #60227 (header() cannot detect the multi-line header with CR).
 (rui, Gustavo)
   . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)

Modified: php/php-src/branches/PHP_5_3/ext/standard/string.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/string.c  2012-03-02 03:38:04 UTC 
(rev 323778)
+++ php/php-src/branches/PHP_5_3/ext/standard/string.c  2012-03-02 03:39:04 UTC 
(rev 323779)
@@ -5240,7 +5240,7 @@
 {
char *haystack, *char_list;
int haystack_len, char_list_len;
-   char *p;
+   char *haystack_ptr, *cl_ptr;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, haystack, 
haystack_len, char_list, char_list_len) == FAILURE) {
RETURN_FALSE;
@@ -5251,11 +5251,15 @@
RETURN_FALSE;
}

-   if ((p = strpbrk(haystack, char_list))) {
-   RETURN_STRINGL(p, (haystack + haystack_len - p), 1);
-   } else {
-   RETURN_FALSE;
+   for (haystack_ptr = haystack; haystack_ptr  (haystack + haystack_len); 
++haystack_ptr) {
+   for (cl_ptr = char_list; cl_ptr  (char_list + char_list_len); 
++cl_ptr) {
+   if (*cl_ptr == *haystack_ptr) {
+   RETURN_STRINGL(haystack_ptr, (haystack + 
haystack_len - haystack_ptr), 1);
+   }
+   }
}
+
+   RETURN_FALSE;
 }
 /* }}} */


Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug60801.phpt
===
(Binary files differ)


Property changes on: 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug60801.phpt
___
Added: svn:mime-type
   + application/octet-stream

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-03-02 03:38:04 UTC (rev 323778)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-03-02 03:39:04 UTC (rev 323779)
@@ -15,6 +15,7 @@
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
 vars). (Laruence)
   . Fixed bug #60978 (exit code incorrect). (Laruence)
+  . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam)
   . Fixed bug #60573 (type hinting with self keyword causes weird errors).
 (Laruence)


Modified: php/php-src/branches/PHP_5_4/ext/standard/string.c
===
--- php/php-src/branches/PHP_5_4/ext/standard/string.c  2012-03-02 03:38:04 UTC 
(rev 323778)
+++ php/php-src/branches/PHP_5_4/ext/standard/string.c  2012-03-02 03:39:04 UTC 
(rev 323779)
@@ -5315,7 +5315,7 @@
 {
char *haystack, *char_list;
int haystack_len, char_list_len;
-   char *p;
+   char *haystack_ptr, *cl_ptr;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, haystack, 
haystack_len, char_list, char_list_len) == FAILURE) {
RETURN_FALSE;
@@ -5326,11 +5326,15 @@
RETURN_FALSE;
}

-   if ((p = strpbrk(haystack, char_list))) {
-   RETURN_STRINGL(p, (haystack + haystack_len - p), 1);
-   } else {
-   RETURN_FALSE;
+   for (haystack_ptr = haystack; haystack_ptr  (haystack + haystack_len); 
++haystack_ptr) {
+   for (cl_ptr = char_list; cl_ptr  (char_list + char_list_len); 
++cl_ptr) {
+   if (*cl_ptr == *haystack_ptr) {
+   RETURN_STRINGL(haystack_ptr, (haystack + 
haystack_len - haystack_ptr), 1);
+   }
+   }
}
+
+   RETURN_FALSE;
 }
 /* }}} */


Added: php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60801.phpt

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2012-02-29 Thread Christopher Jones
sixd Wed, 29 Feb 2012 18:46:17 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323676

Log:
Remove backported from 5.4 comments since 5.3 is the base version these bugs 
are fixed.  Reorder.

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-29 18:26:17 UTC (rev 323675)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-29 18:46:17 UTC (rev 323676)
@@ -253,32 +253,30 @@
   . Fixed bug #52013 (Unable to decompress files in a compressed phar). 
(Hannes)

 - PHP-FPM SAPI:
+  . Dropped restriction of not setting the same value multiple times, the last
+one holds. (giovanni at giacobbi dot net, fat)
+  . Added .phar to default authorized extensions. (fat)
   . Fixed bug #60659 (FPM does not clear auth_user on request accept).
 (bonbons at linux-vserver dot org)
   . Fixed bug #60629 (memory corruption when web server closed the fcgi fd).
 (fat)
+  . Enhance error log when the primary script can't be open. FR #60199. (fat)
   . Fixed bug #60179 (php_flag and php_value does not work properly). (fat)
-  . Fixed bug #55526 (Heartbeat causes a lot of unnecessary events). (fat)
+  . Fixed bug #55577 (status.html does not install). (fat)
   . Fixed bug #55533 (The -d parameter doesn't work). (fat)
-  . Implemented FR #52569 (Add the ondemand process-manager
-to allow zero children). (fat)
+  . Fixed bug #55526 (Heartbeat causes a lot of unnecessary events). (fat)
   . Fixed bug #55486 (status show BIG processes number). (fat)
-  . Fixed bug #55577 (status.html does not install). (fat)
-  . Backported from 5.4 branch (Dropped restriction of not setting the same
-value multiple times, the last one holds).
-(giovanni at giacobbi dot net, fat)
-  . Backported FR #55166 from 5.4 branch (Added process.max to control
-the number of process FPM can fork). (fat)
-  . Backported FR #55181 from 5.4 branch (Enhance security by limiting access
-to user defined extensions). (fat)
-  . Backported FR #54098 from 5.4 branch (Lowered process manager
-default value). (fat)
-  . Backported FR #52052 from 5.4 branch (Added partial syslog support). (fat)
+  . Enhanced security by limiting access to user defined extensions.
+FR #55181. (fat)
+  . Added process.max to control the number of process FPM can fork. FR #55166.
+(fat)
   . Implemented FR #54577 (Enhanced status page with full status and details
 about each processes. Also provide a web page (status.html) for
 real-time FPM status. (fat)
-  . Enhance error log when the primary script can't be open. FR #60199. (fat)
-  . Added .phar to default authorized extensions. (fat)
+  . Lowered default value for Process Manager. FR #54098. (fat)
+  . Implemented FR #52569 (Add the ondemand process-manager
+to allow zero children). (fat)
+  . Added partial syslog support (on error_log only). FR #52052. (fat)

 - Postgres:
   . Fixed bug #60244 (pg_fetch_* functions do not validate that row param
@@ -820,7 +818,7 @@

 - Tokenizer Extension
   . Fixed bug #54089 (token_get_all() does not stop after __halt_compiler).
-(Ilia)
+(Nikita Popov, Ilia)

 - XSL extension:
   . Fixed memory leaked introduced by the NULL poisoning patch.

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2012-02-29 Thread Christopher Jones
sixd Wed, 29 Feb 2012 20:48:17 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323677

Log:
Add the CVE numbers that were mentioned in the related php.net announcements

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-29 18:46:17 UTC (rev 323676)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-29 20:48:17 UTC (rev 323677)
@@ -79,7 +79,7 @@

 - Core:
   . Added max_input_vars directive to prevent attacks based on hash collisions
-(Dmitry).
+(CVE-2011-4885) (Dmitry).
   . Fixed bug #60205 (possible integer overflow in content_length). (Laruence)
   . Fixed bug #60139 (Anonymous functions create cycles not detected by the
 GC). (Dmitry)
@@ -158,7 +158,7 @@

 - EXIF:
   . Fixed bug #60150 (Integer overflow during the parsing of invalid exif
-header). (Stas, flolechaud at gmail dot com)
+header). (CVE-2011-4566) (Stas, flolechaud at gmail dot com)

 - Fileinfo:
   . Fixed bug #60094 (C++ comment fails in c89). (Laruence)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Dmitry Stogov

Hi Laruence,

The attached patch looks wired. The patch on top of it (r323563) makes 
it better. However, in my opinion it fixes a common problem just in a 
single place. Each call to __toString() that makes side effects may 
cause the similar problem. It would be great to make a right fix in 
zend_std_cast_object_tostring() itself, but probably it would require 
API change (e.g. sending zval** instead of zval*). So it could be fixed 
properly only in trunk.


Thanks. Dmitry.

On 02/25/2012 08:41 AM, Laruence wrote:

Dmitry:
you might want to review this fix.

let me explain why crash before this fix.

when doing parse_parameter,  then convert the object to string by
calling the ce-cast_object,

and passed the same pointer(although there was a separation), to
the cast_object..

then if __toString method stash $this somewhere, after the
parameters clean up,  the $this pointer will be impending..

then in the next loop, the return_value will happen used the same adress,,

then balalala, cause the segfault..

sorry for my poor english,  and hope I have made myself clearly,
if there is any question , plz write me.

thanks

On Sat, Feb 25, 2012 at 12:36 PM, Xinchen Huilarue...@php.net  wrote:

laruence Sat, 25 Feb 2012 04:36:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323489

Log:
Fixed bug #61165 (Segfault - strip_tags())

Bug: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-25 03:19:27 UTC (rev 323488)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-25 04:36:08 UTC (rev 323489)
@@ -3,6 +3,7 @@
  ?? ??? 2012, PHP 5.3.11

  - Core:
+  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-25 03:19:27 UTC 
(rev 323488)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-25 04:36:08 UTC 
(rev 323489)
@@ -254,10 +254,15 @@
  static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
  {
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
-   SEPARATE_ZVAL_IF_NOT_REF(arg);
-   if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING 
TSRMLS_CC) == SUCCESS) {
+   zval *obj;
+   ALLOC_ZVAL(obj);
+   MAKE_COPY_ZVAL(arg, obj);
+   if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, IS_STRING 
TSRMLS_CC) == SUCCESS) {
+   zval_ptr_dtor(arg);
+   *arg = obj;
return SUCCESS;
}
+   zval_ptr_dtor(obj);
}
/* Standard PHP objects */
if (Z_OBJ_HT_PP(arg) ==std_object_handlers || !Z_OBJ_HANDLER_PP(arg, 
cast_object)) {

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-02-25 03:19:27 UTC (rev 323488)
+++ php/php-src/trunk/NEWS  2012-02-25 04:36:08 UTC (rev 323489)
@@ -6,6 +6,7 @@
   . World domination

  - Core:
+  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
 (Nikic, Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical

Modified: php/php-src/trunk/Zend/zend_API.c
===
--- php/php-src/trunk/Zend/zend_API.c   2012-02-25 03:19:27 UTC (rev 323488)
+++ php/php-src/trunk/Zend/zend_API.c   2012-02-25 04:36:08 UTC (rev 323489)
@@ -262,12 +262,17 @@
  static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type 
TSRMLS_DC) /* {{{ */
  {
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
-   SEPARATE_ZVAL_IF_NOT_REF(arg);
-   if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, type 
TSRMLS_CC) == SUCCESS) {
+   zval *obj;
+   ALLOC_ZVAL(obj);
+   MAKE_COPY_ZVAL(arg, obj);
+   if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, type 
TSRMLS_CC) == SUCCESS) {
+   zval_ptr_dtor(arg);
+   *arg = obj;
*pl = Z_STRLEN_PP(arg);
*p = Z_STRVAL_PP(arg);
return SUCCESS;
}
+   zval_ptr_dtor(obj);
}

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Laruence
On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563) makes it
 better. However, in my opinion it fixes a common problem just in a single
 place. Each call to __toString() that makes side effects may cause the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would require API
Hi:
   before this fix, I thought about the same idea of that.

   but,  you know,  such change will need all exts who implmented
their own cast_object handler change there codes too.

   for now,  I exam the usage of std_cast_object_tostring,  most of
them do the similar things like this fix to avoid this issues(like
ZEND_CAST handler).

   so I think,  maybe it's okey for a temporary fix :)

thanks
 change (e.g. sending zval** instead of zval*). So it could be fixed properly
 only in trunk.

 Thanks. Dmitry.


 On 02/25/2012 08:41 AM, Laruence wrote:

 Dmitry:
    you might want to review this fix.

    let me explain why crash before this fix.

    when doing parse_parameter,  then convert the object to string by
 calling the ce-cast_object,

    and passed the same pointer(although there was a separation), to
 the cast_object..

    then if __toString method stash $this somewhere, after the
 parameters clean up,  the $this pointer will be impending..

    then in the next loop, the return_value will happen used the same
 adress,,

    then balalala, cause the segfault..

    sorry for my poor english,  and hope I have made myself clearly,
 if there is any question , plz write me.

 thanks

 On Sat, Feb 25, 2012 at 12:36 PM, Xinchen Huilarue...@php.net  wrote:

 laruence                                 Sat, 25 Feb 2012 04:36:08 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323489

 Log:
 Fixed bug #61165 (Segfault - strip_tags())

 Bug: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()

 Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/Zend/zend_API.c

 Modified: php/php-src/branches/PHP_5_3/NEWS
 ===
 --- php/php-src/branches/PHP_5_3/NEWS   2012-02-25 03:19:27 UTC (rev
 323488)
 +++ php/php-src/branches/PHP_5_3/NEWS   2012-02-25 04:36:08 UTC (rev
 323489)
 @@ -3,6 +3,7 @@
  ?? ??? 2012, PHP 5.3.11

  - Core:
 +  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).

 Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
 ===
 --- php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-02-25
 03:19:27 UTC (rev 323488)
 +++ php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-02-25
 04:36:08 UTC (rev 323489)
 @@ -254,10 +254,15 @@
  static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
  {
        if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
 -               SEPARATE_ZVAL_IF_NOT_REF(arg);
 -               if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg,
 IS_STRING TSRMLS_CC) == SUCCESS) {
 +               zval *obj;
 +               ALLOC_ZVAL(obj);
 +               MAKE_COPY_ZVAL(arg, obj);
 +               if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj,
 IS_STRING TSRMLS_CC) == SUCCESS) {
 +                       zval_ptr_dtor(arg);
 +                       *arg = obj;
                        return SUCCESS;
                }
 +               zval_ptr_dtor(obj);
        }
        /* Standard PHP objects */
        if (Z_OBJ_HT_PP(arg) ==std_object_handlers ||
 !Z_OBJ_HANDLER_PP(arg, cast_object)) {


 Modified: php/php-src/trunk/NEWS
 ===
 --- php/php-src/trunk/NEWS      2012-02-25 03:19:27 UTC (rev 323488)
 +++ php/php-src/trunk/NEWS      2012-02-25 04:36:08 UTC (rev 323489)
 @@ -6,6 +6,7 @@
   . World domination

  - Core:
 +  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
     (Nikic, Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete
 numerical

 Modified: php/php-src/trunk/Zend/zend_API.c
 ===
 --- php/php-src/trunk/Zend/zend_API.c   2012-02-25 03:19:27 UTC (rev
 323488)
 +++ php/php-src/trunk/Zend/zend_API.c   2012-02-25 04:36:08 UTC (rev
 323489)
 @@ -262,12 +262,17 @@
  static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int
 type TSRMLS_DC) /* {{{ */
  {
        if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
 -               SEPARATE_ZVAL_IF_NOT_REF(arg);
 -               if (Z_OBJ_HANDLER_PP(arg, 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Laruence
On Mon, Feb 27, 2012 at 4:31 PM, Laruence larue...@php.net wrote:
 On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563) makes it
 better. However, in my opinion it fixes a common problem just in a single
 place. Each call to __toString() that makes side effects may cause the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would require API
 Hi:
   before this fix, I thought about the same idea of that.

   but,  you know,  such change will need all exts who implmented
 their own cast_object handler change there codes too.

   for now,  I exam the usage of std_cast_object_tostring,  most of
 them do the similar things like this fix to avoid this issues(like
 ZEND_CAST handler).

   so I think,  maybe it's okey for a temporary fix :)
what I mean temporary is, apply this fix to 5.3 and 5.4

then do the right fix which you said to 5.4.1 :)

thanks

 thanks
 change (e.g. sending zval** instead of zval*). So it could be fixed properly
 only in trunk.

 Thanks. Dmitry.


 On 02/25/2012 08:41 AM, Laruence wrote:

 Dmitry:
    you might want to review this fix.

    let me explain why crash before this fix.

    when doing parse_parameter,  then convert the object to string by
 calling the ce-cast_object,

    and passed the same pointer(although there was a separation), to
 the cast_object..

    then if __toString method stash $this somewhere, after the
 parameters clean up,  the $this pointer will be impending..

    then in the next loop, the return_value will happen used the same
 adress,,

    then balalala, cause the segfault..

    sorry for my poor english,  and hope I have made myself clearly,
 if there is any question , plz write me.

 thanks

 On Sat, Feb 25, 2012 at 12:36 PM, Xinchen Huilarue...@php.net  wrote:

 laruence                                 Sat, 25 Feb 2012 04:36:08 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323489

 Log:
 Fixed bug #61165 (Segfault - strip_tags())

 Bug: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()

 Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/Zend/zend_API.c

 Modified: php/php-src/branches/PHP_5_3/NEWS
 ===
 --- php/php-src/branches/PHP_5_3/NEWS   2012-02-25 03:19:27 UTC (rev
 323488)
 +++ php/php-src/branches/PHP_5_3/NEWS   2012-02-25 04:36:08 UTC (rev
 323489)
 @@ -3,6 +3,7 @@
  ?? ??? 2012, PHP 5.3.11

  - Core:
 +  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).

 Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
 ===
 --- php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-02-25
 03:19:27 UTC (rev 323488)
 +++ php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-02-25
 04:36:08 UTC (rev 323489)
 @@ -254,10 +254,15 @@
  static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
  {
        if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
 -               SEPARATE_ZVAL_IF_NOT_REF(arg);
 -               if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg,
 IS_STRING TSRMLS_CC) == SUCCESS) {
 +               zval *obj;
 +               ALLOC_ZVAL(obj);
 +               MAKE_COPY_ZVAL(arg, obj);
 +               if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj,
 IS_STRING TSRMLS_CC) == SUCCESS) {
 +                       zval_ptr_dtor(arg);
 +                       *arg = obj;
                        return SUCCESS;
                }
 +               zval_ptr_dtor(obj);
        }
        /* Standard PHP objects */
        if (Z_OBJ_HT_PP(arg) ==std_object_handlers ||
 !Z_OBJ_HANDLER_PP(arg, cast_object)) {


 Modified: php/php-src/trunk/NEWS
 ===
 --- php/php-src/trunk/NEWS      2012-02-25 03:19:27 UTC (rev 323488)
 +++ php/php-src/trunk/NEWS      2012-02-25 04:36:08 UTC (rev 323489)
 @@ -6,6 +6,7 @@
   . World domination

  - Core:
 +  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
     (Nikic, Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete
 numerical

 Modified: php/php-src/trunk/Zend/zend_API.c
 ===
 --- php/php-src/trunk/Zend/zend_API.c   2012-02-25 03:19:27 UTC (rev
 323488)
 +++ php/php-src/trunk/Zend/zend_API.c   2012-02-25 04:36:08 UTC (rev
 323489)
 @@ -262,12 +262,17 @@
  static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Dmitry Stogov

On 02/27/2012 12:37 PM, Laruence wrote:

On Mon, Feb 27, 2012 at 4:31 PM, Laruencelarue...@php.net  wrote:

On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogovdmi...@zend.com  wrote:

Hi Laruence,

The attached patch looks wired. The patch on top of it (r323563) makes it
better. However, in my opinion it fixes a common problem just in a single
place. Each call to __toString() that makes side effects may cause the
similar problem. It would be great to make a right fix in
zend_std_cast_object_tostring() itself, but probably it would require API

Hi:
   before this fix, I thought about the same idea of that.

   but,  you know,  such change will need all exts who implmented
their own cast_object handler change there codes too.

   for now,  I exam the usage of std_cast_object_tostring,  most of
them do the similar things like this fix to avoid this issues(like
ZEND_CAST handler).

   so I think,  maybe it's okey for a temporary fix :)

what I mean temporary is, apply this fix to 5.3 and 5.4

then do the right fix which you said to 5.4.1 :)


we won't be able to change API in 5.4.1, so it's for 5.5.

Thanks. Dmitry.


thanks


thanks

change (e.g. sending zval** instead of zval*). So it could be fixed properly
only in trunk.

Thanks. Dmitry.


On 02/25/2012 08:41 AM, Laruence wrote:


Dmitry:
you might want to review this fix.

let me explain why crash before this fix.

when doing parse_parameter,  then convert the object to string by
calling the ce-cast_object,

and passed the same pointer(although there was a separation), to
the cast_object..

then if __toString method stash $this somewhere, after the
parameters clean up,  the $this pointer will be impending..

then in the next loop, the return_value will happen used the same
adress,,

then balalala, cause the segfault..

sorry for my poor english,  and hope I have made myself clearly,
if there is any question , plz write me.

thanks

On Sat, Feb 25, 2012 at 12:36 PM, Xinchen Huilarue...@php.netwrote:


laruence Sat, 25 Feb 2012 04:36:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323489

Log:
Fixed bug #61165 (Segfault - strip_tags())

Bug: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-25 03:19:27 UTC (rev
323488)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-25 04:36:08 UTC (rev
323489)
@@ -3,6 +3,7 @@
  ?? ??? 2012, PHP 5.3.11

  - Core:
+  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-25
03:19:27 UTC (rev 323488)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-25
04:36:08 UTC (rev 323489)
@@ -254,10 +254,15 @@
  static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
  {
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
-   SEPARATE_ZVAL_IF_NOT_REF(arg);
-   if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg,
IS_STRING TSRMLS_CC) == SUCCESS) {
+   zval *obj;
+   ALLOC_ZVAL(obj);
+   MAKE_COPY_ZVAL(arg, obj);
+   if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj,
IS_STRING TSRMLS_CC) == SUCCESS) {
+   zval_ptr_dtor(arg);
+   *arg = obj;
return SUCCESS;
}
+   zval_ptr_dtor(obj);
}
/* Standard PHP objects */
if (Z_OBJ_HT_PP(arg) ==std_object_handlers ||
!Z_OBJ_HANDLER_PP(arg, cast_object)) {


Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-02-25 03:19:27 UTC (rev 323488)
+++ php/php-src/trunk/NEWS  2012-02-25 04:36:08 UTC (rev 323489)
@@ -6,6 +6,7 @@
   . World domination

  - Core:
+  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
 (Nikic, Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete
numerical

Modified: php/php-src/trunk/Zend/zend_API.c
===
--- php/php-src/trunk/Zend/zend_API.c   2012-02-25 03:19:27 UTC (rev
323488)
+++ php/php-src/trunk/Zend/zend_API.c   2012-02-25 04:36:08 UTC (rev
323489)
@@ -262,12 +262,17 @@
  static int 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Derick Rethans
On Mon, 27 Feb 2012, Laruence wrote:

 On Mon, Feb 27, 2012 at 4:31 PM, Laruence larue...@php.net wrote:
  On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com wrote:
 
  The attached patch looks wired. The patch on top of it (r323563) makes it
  better. However, in my opinion it fixes a common problem just in a single
  place. Each call to __toString() that makes side effects may cause the
  similar problem. It would be great to make a right fix in
  zend_std_cast_object_tostring() itself, but probably it would require API
  Hi:
    before this fix, I thought about the same idea of that.
 
    but,  you know,  such change will need all exts who implmented 
  their own cast_object handler change there codes too.
 
    for now,  I exam the usage of std_cast_object_tostring,  most of 
  them do the similar things like this fix to avoid this issues(like 
  ZEND_CAST handler).
 
    so I think,  maybe it's okey for a temporary fix :)

 what I mean temporary is, apply this fix to 5.3 and 5.4
 
 then do the right fix which you said to 5.4.1 :)

You can't break extension APIs between 5.4.0 and 5.4.1 either, API 
changes can only into trunk.

cheers,
Derick

-- 
http://derickrethans.nl | http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Pierre Joye
On Mon, Feb 27, 2012 at 11:17 AM, Derick Rethans der...@php.net wrote:

 You can't break extension APIs between 5.4.0 and 5.4.1 either, API
 changes can only into trunk.


And ABI neither.

-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/php.h trunk/main/php.h

2012-02-27 Thread Rasmus Lerdorf
rasmus   Mon, 27 Feb 2012 12:16:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323577

Log:
Fix bug 61193

Bug: https://bugs.php.net/61193 (Open) PHP_EOL definition for Mac OS X is wrong 
and unused
  
Changed paths:
U   php/php-src/branches/PHP_5_3/main/php.h
U   php/php-src/trunk/main/php.h

Modified: php/php-src/branches/PHP_5_3/main/php.h
===
--- php/php-src/branches/PHP_5_3/main/php.h 2012-02-27 11:30:03 UTC (rev 
323576)
+++ php/php-src/branches/PHP_5_3/main/php.h 2012-02-27 12:16:39 UTC (rev 
323577)
@@ -60,15 +60,10 @@
 #  else
 #  define PHPAPI
 #  endif
-
-#define THREAD_LS
-#define PHP_DIR_SEPARATOR '/'
-#if defined(__MacOSX__)
-#define PHP_EOL \r
-#else
-#define PHP_EOL \n
+#  define THREAD_LS
+#  define PHP_DIR_SEPARATOR '/'
+#  define PHP_EOL \n
 #endif
-#endif

 #ifdef NETWARE
 /* For php_get_uname() function */

Modified: php/php-src/trunk/main/php.h
===
--- php/php-src/trunk/main/php.h2012-02-27 11:30:03 UTC (rev 323576)
+++ php/php-src/trunk/main/php.h2012-02-27 12:16:39 UTC (rev 323577)
@@ -60,15 +60,10 @@
 #  else
 #  define PHPAPI
 #  endif
-
-#define THREAD_LS
-#define PHP_DIR_SEPARATOR '/'
-#if defined(__MacOSX__)
-#define PHP_EOL \r
-#else
-#define PHP_EOL \n
+#  define THREAD_LS
+#  define PHP_DIR_SEPARATOR '/'
+#  define PHP_EOL \n
 #endif
-#endif

 #ifdef NETWARE
 /* For php_get_uname() function */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Richard Lynch
On Mon, February 27, 2012 2:31 am, Laruence wrote:
 On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com
 wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563)
 makes it
 better. However, in my opinion it fixes a common problem just in a
 single
 place. Each call to __toString() that makes side effects may cause
 the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would
 require API
 Hi:
before this fix, I thought about the same idea of that.

but,  you know,  such change will need all exts who implmented
 their own cast_object handler change there codes too.

for now,  I exam the usage of std_cast_object_tostring,  most of
 them do the similar things like this fix to avoid this issues(like
 ZEND_CAST handler).

so I think,  maybe it's okey for a temporary fix :)

Perhaps a better solution would be to make a NEW function that uses
zval** and deprecate the old one with memory leaks.

Old extensions remain functional, new extension consume less memory.

(This presumes I actually understand the issue, which is questionable.)

-- 
brain cancer update:
http://richardlynch.blogspot.com/search/label/brain%20tumor
Donate:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=FS9NLTNEEKWBE



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Anthony Ferrara
Out of curiosity, why are you changing it to copy the object for the
result of the cast operation?  cast_object should init the result
zval, so why go through the step of copying the starting object to it?
 Wouldn't it be easier just to do:

if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
zval *result;
ALLOC_ZVAL(result);
if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, result, type 
TSRMLS_CC)
== SUCCESS) {
zval_ptr_dtor(arg);
*pl = Z_STRLEN_PP(result);
*p = Z_STRVAL_PP(result);
zval_ptr_dtor(result);
return SUCCESS;
}
zval_ptr_dtor(result);
}

Keeping both completely separate, and not having the possibility of
corrupting the arg object pointer?  As it is right now (with the patch
in the first mail), wouldn't the possibility still exist of nuking the
arg object pointer which could be used elsewhere (and hence cause the
memory leak and segfault when that variable is referenced again)?

(Un tested as of yet, just throwing it out there as it seems kind of
weird to overwrite the arg pointer for what seems like no reason)...

Anthony



On Mon, Feb 27, 2012 at 10:22 AM, Richard Lynch c...@l-i-e.com wrote:
 On Mon, February 27, 2012 2:31 am, Laruence wrote:
 On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com
 wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563)
 makes it
 better. However, in my opinion it fixes a common problem just in a
 single
 place. Each call to __toString() that makes side effects may cause
 the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would
 require API
 Hi:
    before this fix, I thought about the same idea of that.

    but,  you know,  such change will need all exts who implmented
 their own cast_object handler change there codes too.

    for now,  I exam the usage of std_cast_object_tostring,  most of
 them do the similar things like this fix to avoid this issues(like
 ZEND_CAST handler).

    so I think,  maybe it's okey for a temporary fix :)

 Perhaps a better solution would be to make a NEW function that uses
 zval** and deprecate the old one with memory leaks.

 Old extensions remain functional, new extension consume less memory.

 (This presumes I actually understand the issue, which is questionable.)

 --
 brain cancer update:
 http://richardlynch.blogspot.com/search/label/brain%20tumor
 Donate:
 https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=FS9NLTNEEKWBE



 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Xinchen Hui
Sent from my iPad

在 2012-2-28,0:10,Anthony Ferrara ircmax...@gmail.com 写道:

 Out of curiosity, why are you changing it to copy the object for the
 result of the cast operation?  cast_object should init the result
 zval, so why go through the step of copying the starting object to
plz look at the final fix: r323563

thanks
 r323563
 Wouldn't it be easier just to do:

if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
zval *result;
ALLOC_ZVAL(result);
if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, result, type TSRMLS_CC)
 == SUCCESS) {
zval_ptr_dtor(arg);
*pl = Z_STRLEN_PP(result);
*p = Z_STRVAL_PP(result);
zval_ptr_dtor(result);
return SUCCESS;
}
zval_ptr_dtor(result);
}

 Keeping both completely separate, and not having the possibility of
 corrupting the arg object pointer?  As it is right now (with the patch
 in the first mail), wouldn't the possibility still exist of nuking the
 arg object pointer which could be used elsewhere (and hence cause the
 memory leak and segfault when that variable is referenced again)?

 (Un tested as of yet, just throwing it out there as it seems kind of
 weird to overwrite the arg pointer for what seems like no reason)...

 Anthony



 On Mon, Feb 27, 2012 at 10:22 AM, Richard Lynch c...@l-i-e.com wrote:
 On Mon, February 27, 2012 2:31 am, Laruence wrote:
 On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com
 wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563)
 makes it
 better. However, in my opinion it fixes a common problem just in a
 single
 place. Each call to __toString() that makes side effects may cause
 the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would
 require API
 Hi:
before this fix, I thought about the same idea of that.

but,  you know,  such change will need all exts who implmented
 their own cast_object handler change there codes too.

for now,  I exam the usage of std_cast_object_tostring,  most of
 them do the similar things like this fix to avoid this issues(like
 ZEND_CAST handler).

so I think,  maybe it's okey for a temporary fix :)

 Perhaps a better solution would be to make a NEW function that uses
 zval** and deprecate the old one with memory leaks.

 Old extensions remain functional, new extension consume less memory.

 (This presumes I actually understand the issue, which is questionable.)

 --
 brain cancer update:
 http://richardlynch.blogspot.com/search/label/brain%20tumor
 Donate:
 https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=FS9NLTNEEKWBE



 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Anthony Ferrara
I initially looked at the final fix when I discovered the issue.
Follow me out on this.  This is the current code as-implemented in
r323563:

265 zval *obj;
266 MAKE_STD_ZVAL(obj);
267 if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, type
TSRMLS_CC) == SUCCESS) {
268 zval_ptr_dtor(arg);
269 *arg = obj;
270 *pl = Z_STRLEN_PP(arg);
271 *p = Z_STRVAL_PP(arg);
272 return SUCCESS;
273 }
274 efree(obj);

The issue that I originally identified (overwriting the argument
pointer) is still happening.  Is there any reason for overwriting the
arg pointer?  Wouldn't it be better to just do the Z_STRLEN_PP and
Z_STRVAL_PP operations on obj instead, and zval_ptr_dtor it as well
(instead of efree, as that way if a reference is stored somewhere it
won't result in a double free, or a segfault for accessing freed
memory)?

Thanks,

Anthony

On Mon, Feb 27, 2012 at 11:39 AM, Xinchen Hui larue...@gmail.com wrote:
 Sent from my iPad

 在 2012-2-28,0:10,Anthony Ferrara ircmax...@gmail.com 写道:

 Out of curiosity, why are you changing it to copy the object for the
 result of the cast operation?  cast_object should init the result
 zval, so why go through the step of copying the starting object to
 plz look at the final fix: r323563

 thanks
 r323563
 Wouldn't it be easier just to do:

    if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
        zval *result;
        ALLOC_ZVAL(result);
        if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, result, type TSRMLS_CC)
 == SUCCESS) {
            zval_ptr_dtor(arg);
            *pl = Z_STRLEN_PP(result);
            *p = Z_STRVAL_PP(result);
            zval_ptr_dtor(result);
            return SUCCESS;
        }
        zval_ptr_dtor(result);
    }

 Keeping both completely separate, and not having the possibility of
 corrupting the arg object pointer?  As it is right now (with the patch
 in the first mail), wouldn't the possibility still exist of nuking the
 arg object pointer which could be used elsewhere (and hence cause the
 memory leak and segfault when that variable is referenced again)?

 (Un tested as of yet, just throwing it out there as it seems kind of
 weird to overwrite the arg pointer for what seems like no reason)...

 Anthony



 On Mon, Feb 27, 2012 at 10:22 AM, Richard Lynch c...@l-i-e.com wrote:
 On Mon, February 27, 2012 2:31 am, Laruence wrote:
 On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com
 wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563)
 makes it
 better. However, in my opinion it fixes a common problem just in a
 single
 place. Each call to __toString() that makes side effects may cause
 the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would
 require API
 Hi:
    before this fix, I thought about the same idea of that.

    but,  you know,  such change will need all exts who implmented
 their own cast_object handler change there codes too.

    for now,  I exam the usage of std_cast_object_tostring,  most of
 them do the similar things like this fix to avoid this issues(like
 ZEND_CAST handler).

    so I think,  maybe it's okey for a temporary fix :)

 Perhaps a better solution would be to make a NEW function that uses
 zval** and deprecate the old one with memory leaks.

 Old extensions remain functional, new extension consume less memory.

 (This presumes I actually understand the issue, which is questionable.)

 --
 brain cancer update:
 http://richardlynch.blogspot.com/search/label/brain%20tumor
 Donate:
 https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=FS9NLTNEEKWBE



 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Xinchen Hui
On Tue, Feb 28, 2012 at 1:10 AM, Anthony Ferrara ircmax...@gmail.com wrote:
 I initially looked at the final fix when I discovered the issue.
 Follow me out on this.  This is the current code as-implemented in
 r323563:

    265                 zval *obj;
    266                 MAKE_STD_ZVAL(obj);
    267                 if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, type
 TSRMLS_CC) == SUCCESS) {
    268                         zval_ptr_dtor(arg);
    269                         *arg = obj;
    270                         *pl = Z_STRLEN_PP(arg);
    271                         *p = Z_STRVAL_PP(arg);
    272                         return SUCCESS;
    273                 }
    274                 efree(obj);

 The issue that I originally identified (overwriting the argument
 pointer) is still happening.  Is there any reason for overwriting the
 arg pointer?  Wouldn't it be better to just do the Z_STRLEN_PP and
 Z_STRVAL_PP operations on obj instead, and zval_ptr_dtor it as well
Oops, you are right..  thanks for pointing this out.
:)
 (instead of efree, as that way if a reference is stored somewhere it
 won't result in a double free, or a segfault for accessing freed
 memory)?

 Thanks,

 Anthony

 On Mon, Feb 27, 2012 at 11:39 AM, Xinchen Hui larue...@gmail.com wrote:
 Sent from my iPad

 在 2012-2-28,0:10,Anthony Ferrara ircmax...@gmail.com 写道:

 Out of curiosity, why are you changing it to copy the object for the
 result of the cast operation?  cast_object should init the result
 zval, so why go through the step of copying the starting object to
 plz look at the final fix: r323563

 thanks
 r323563
 Wouldn't it be easier just to do:

    if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
        zval *result;
        ALLOC_ZVAL(result);
        if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, result, type TSRMLS_CC)
 == SUCCESS) {
            zval_ptr_dtor(arg);
            *pl = Z_STRLEN_PP(result);
            *p = Z_STRVAL_PP(result);
            zval_ptr_dtor(result);
            return SUCCESS;
        }
        zval_ptr_dtor(result);
    }

 Keeping both completely separate, and not having the possibility of
 corrupting the arg object pointer?  As it is right now (with the patch
 in the first mail), wouldn't the possibility still exist of nuking the
 arg object pointer which could be used elsewhere (and hence cause the
 memory leak and segfault when that variable is referenced again)?

 (Un tested as of yet, just throwing it out there as it seems kind of
 weird to overwrite the arg pointer for what seems like no reason)...

 Anthony



 On Mon, Feb 27, 2012 at 10:22 AM, Richard Lynch c...@l-i-e.com wrote:
 On Mon, February 27, 2012 2:31 am, Laruence wrote:
 On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com
 wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563)
 makes it
 better. However, in my opinion it fixes a common problem just in a
 single
 place. Each call to __toString() that makes side effects may cause
 the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would
 require API
 Hi:
    before this fix, I thought about the same idea of that.

    but,  you know,  such change will need all exts who implmented
 their own cast_object handler change there codes too.

    for now,  I exam the usage of std_cast_object_tostring,  most of
 them do the similar things like this fix to avoid this issues(like
 ZEND_CAST handler).

    so I think,  maybe it's okey for a temporary fix :)

 Perhaps a better solution would be to make a NEW function that uses
 zval** and deprecate the old one with memory leaks.

 Old extensions remain functional, new extension consume less memory.

 (This presumes I actually understand the issue, which is questionable.)

 --
 brain cancer update:
 http://richardlynch.blogspot.com/search/label/brain%20tumor
 Donate:
 https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=FS9NLTNEEKWBE



 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
惠新宸        laruence
Senior PHP Engineer
http://www.laruence.com

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-27 Thread Xinchen Hui
On Tue, Feb 28, 2012 at 10:38 AM, Xinchen Hui larue...@gmail.com wrote:
 On Tue, Feb 28, 2012 at 1:10 AM, Anthony Ferrara ircmax...@gmail.com wrote:
 I initially looked at the final fix when I discovered the issue.
 Follow me out on this.  This is the current code as-implemented in
 r323563:

    265                 zval *obj;
    266                 MAKE_STD_ZVAL(obj);
    267                 if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, type
 TSRMLS_CC) == SUCCESS) {
    268                         zval_ptr_dtor(arg);
    269                         *arg = obj;
    270                         *pl = Z_STRLEN_PP(arg);
    271                         *p = Z_STRVAL_PP(arg);
    272                         return SUCCESS;
    273                 }
    274                 efree(obj);

 The issue that I originally identified (overwriting the argument
 pointer) is still happening.  Is there any reason for overwriting the
 arg pointer?  Wouldn't it be better to just do the Z_STRLEN_PP and
 Z_STRVAL_PP operations on obj instead, and zval_ptr_dtor it as well
 Oops, you are right..  thanks for pointing this out.
 :)
Sorry, I miss-read your words. so I revoke my previous words.

the reason for why overwriting arg, is we should record that new temp
zval(IS_STRING), then release it while doing cleanup parameters.

and also, fo 5.3,  no p and pl paramters.

thanks

 (instead of efree, as that way if a reference is stored somewhere it
 won't result in a double free, or a segfault for accessing freed
 memory)?

 Thanks,

 Anthony

 On Mon, Feb 27, 2012 at 11:39 AM, Xinchen Hui larue...@gmail.com wrote:
 Sent from my iPad

 在 2012-2-28,0:10,Anthony Ferrara ircmax...@gmail.com 写道:

 Out of curiosity, why are you changing it to copy the object for the
 result of the cast operation?  cast_object should init the result
 zval, so why go through the step of copying the starting object to
 plz look at the final fix: r323563

 thanks
 r323563
 Wouldn't it be easier just to do:

    if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
        zval *result;
        ALLOC_ZVAL(result);
        if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, result, type TSRMLS_CC)
 == SUCCESS) {
            zval_ptr_dtor(arg);
            *pl = Z_STRLEN_PP(result);
            *p = Z_STRVAL_PP(result);
            zval_ptr_dtor(result);
            return SUCCESS;
        }
        zval_ptr_dtor(result);
    }

 Keeping both completely separate, and not having the possibility of
 corrupting the arg object pointer?  As it is right now (with the patch
 in the first mail), wouldn't the possibility still exist of nuking the
 arg object pointer which could be used elsewhere (and hence cause the
 memory leak and segfault when that variable is referenced again)?

 (Un tested as of yet, just throwing it out there as it seems kind of
 weird to overwrite the arg pointer for what seems like no reason)...

 Anthony



 On Mon, Feb 27, 2012 at 10:22 AM, Richard Lynch c...@l-i-e.com wrote:
 On Mon, February 27, 2012 2:31 am, Laruence wrote:
 On Mon, Feb 27, 2012 at 4:00 PM, Dmitry Stogov dmi...@zend.com
 wrote:
 Hi Laruence,

 The attached patch looks wired. The patch on top of it (r323563)
 makes it
 better. However, in my opinion it fixes a common problem just in a
 single
 place. Each call to __toString() that makes side effects may cause
 the
 similar problem. It would be great to make a right fix in
 zend_std_cast_object_tostring() itself, but probably it would
 require API
 Hi:
    before this fix, I thought about the same idea of that.

    but,  you know,  such change will need all exts who implmented
 their own cast_object handler change there codes too.

    for now,  I exam the usage of std_cast_object_tostring,  most of
 them do the similar things like this fix to avoid this issues(like
 ZEND_CAST handler).

    so I think,  maybe it's okey for a temporary fix :)

 Perhaps a better solution would be to make a NEW function that uses
 zval** and deprecate the old one with memory leaks.

 Old extensions remain functional, new extension consume less memory.

 (This presumes I actually understand the issue, which is questionable.)

 --
 brain cancer update:
 http://richardlynch.blogspot.com/search/label/brain%20tumor
 Donate:
 https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclickhosted_button_id=FS9NLTNEEKWBE



 --
 PHP Internals - PHP Runtime Development Mailing List
 To unsubscribe, visit: http://www.php.net/unsub.php




 --
 惠新宸        laruence
 Senior PHP Engineer
 http://www.laruence.com



-- 
惠新宸        laruence
Senior PHP Engineer
http://www.laruence.com

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/zend_API.c trunk/Zend/zend_API.c

2012-02-26 Thread Xinchen Hui
laruence Sun, 26 Feb 2012 14:56:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323563

Log:
Improve fix for #61165, the previous one cause #43450 test failed

Bugs: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()
  https://bugs.php.net/43450 (Closed) Memory leak on some functions with 
implicit object __toString() call
  
Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
U   php/php-src/trunk/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-26 10:48:50 UTC 
(rev 323562)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-26 14:56:26 UTC 
(rev 323563)
@@ -255,14 +255,13 @@
 {
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
zval *obj;
-   ALLOC_ZVAL(obj);
-   MAKE_COPY_ZVAL(arg, obj);
+   MAKE_STD_ZVAL(obj);
if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, IS_STRING 
TSRMLS_CC) == SUCCESS) {
zval_ptr_dtor(arg);
*arg = obj;
return SUCCESS;
}
-   zval_ptr_dtor(obj);
+   efree(obj);
}
/* Standard PHP objects */
if (Z_OBJ_HT_PP(arg) == std_object_handlers || !Z_OBJ_HANDLER_PP(arg, 
cast_object)) {

Modified: php/php-src/trunk/Zend/zend_API.c
===
--- php/php-src/trunk/Zend/zend_API.c   2012-02-26 10:48:50 UTC (rev 323562)
+++ php/php-src/trunk/Zend/zend_API.c   2012-02-26 14:56:26 UTC (rev 323563)
@@ -263,8 +263,7 @@
 {
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
zval *obj;
-   ALLOC_ZVAL(obj);
-   MAKE_COPY_ZVAL(arg, obj);
+   MAKE_STD_ZVAL(obj);
if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, type 
TSRMLS_CC) == SUCCESS) {
zval_ptr_dtor(arg);
*arg = obj;
@@ -272,7 +271,7 @@
*p = Z_STRVAL_PP(arg);
return SUCCESS;
}
-   zval_ptr_dtor(obj);
+   efree(obj);
}
/* Standard PHP objects */
if (Z_OBJ_HT_PP(arg) == std_object_handlers || !Z_OBJ_HANDLER_PP(arg, 
cast_object)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/tests/bug34199.phpt branches/PHP_5_3/Zend/tests/bug39602.phpt branches/PHP_5_3/Zend/tests/bug42819.phpt branches/PHP_5_3/Zend/tests/bug43918.phpt bra

2012-02-25 Thread Olivier DOUCET
odoucet  Sat, 25 Feb 2012 12:10:41 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323501

Log:
more verbose skip reason in test files with not so obvious extension 
requirements

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/tests/bug34199.phpt
U   php/php-src/branches/PHP_5_3/Zend/tests/bug39602.phpt
U   php/php-src/branches/PHP_5_3/Zend/tests/bug42819.phpt
U   php/php-src/branches/PHP_5_3/Zend/tests/bug43918.phpt
U   php/php-src/branches/PHP_5_3/Zend/tests/bug50174.phpt
U   php/php-src/branches/PHP_5_3/Zend/tests/gc_024.phpt
U   php/php-src/branches/PHP_5_3/Zend/tests/unset_cv10.phpt
U   php/php-src/branches/PHP_5_3/ext/soap/tests/bugs/bug34657.phpt
U   php/php-src/branches/PHP_5_3/ext/spl/tests/iterator_006.phpt
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/streams/stream_get_line_nb.phpt
U   php/php-src/branches/PHP_5_3/ext/xmlreader/tests/expand.phpt
U   php/php-src/branches/PHP_5_3/sapi/cli/tests/004.phpt
U   php/php-src/branches/PHP_5_3/sapi/cli/tests/005.phpt
U   php/php-src/branches/PHP_5_3/sapi/cli/tests/006.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/bug34199.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/bug39602.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/bug42819.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/bug43918.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/bug50174.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/gc_024.phpt
U   php/php-src/branches/PHP_5_4/Zend/tests/unset_cv10.phpt
U   php/php-src/branches/PHP_5_4/ext/soap/tests/bugs/bug34657.phpt
U   php/php-src/branches/PHP_5_4/ext/spl/tests/iterator_006.phpt
U   
php/php-src/branches/PHP_5_4/ext/standard/tests/streams/stream_get_line_nb.phpt
U   php/php-src/branches/PHP_5_4/ext/xmlreader/tests/expand.phpt
U   php/php-src/branches/PHP_5_4/sapi/cli/tests/004.phpt
U   php/php-src/branches/PHP_5_4/sapi/cli/tests/005.phpt
U   php/php-src/branches/PHP_5_4/sapi/cli/tests/006.phpt
U   php/php-src/branches/PHP_5_4/tests/output/bug60282.phpt
U   php/php-src/trunk/Zend/tests/bug34199.phpt
U   php/php-src/trunk/Zend/tests/bug39602.phpt
U   php/php-src/trunk/Zend/tests/bug42819.phpt
U   php/php-src/trunk/Zend/tests/bug43918.phpt
U   php/php-src/trunk/Zend/tests/bug50174.phpt
U   php/php-src/trunk/Zend/tests/gc_024.phpt
U   php/php-src/trunk/Zend/tests/unset_cv10.phpt
U   php/php-src/trunk/ext/soap/tests/bugs/bug34657.phpt
U   php/php-src/trunk/ext/spl/tests/iterator_006.phpt
U   php/php-src/trunk/ext/standard/tests/streams/stream_get_line_nb.phpt
U   php/php-src/trunk/ext/xmlreader/tests/expand.phpt
U   php/php-src/trunk/sapi/cli/tests/004.phpt
U   php/php-src/trunk/sapi/cli/tests/005.phpt
U   php/php-src/trunk/sapi/cli/tests/006.phpt
U   php/php-src/trunk/tests/output/bug60282.phpt

Modified: php/php-src/branches/PHP_5_3/Zend/tests/bug34199.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug34199.phpt	2012-02-25 12:10:07 UTC (rev 323500)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug34199.phpt	2012-02-25 12:10:41 UTC (rev 323501)
@@ -1,7 +1,7 @@
 --TEST--
 Bug #34199 (if($obj)/if(!$obj) inconsistency because of cast handler)
 --SKIPIF--
-?php if (!extension_loaded(simplexml)) print skip; ?
+?php if (!extension_loaded(simplexml)) print skip SimpleXML extension required; ?
 --FILE--
 ?php
 $xml = root/root;

Modified: php/php-src/branches/PHP_5_3/Zend/tests/bug39602.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug39602.phpt	2012-02-25 12:10:07 UTC (rev 323500)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug39602.phpt	2012-02-25 12:10:41 UTC (rev 323501)
@@ -1,7 +1,7 @@
 --TEST--
 Bug #39602 (Invalid session.save_handler crashes PHP)
 --SKIPIF--
-?php if (!extension_loaded(session)) die(skip); ?
+?php if (!extension_loaded(session)) die(skip session extension required); ?
 --INI--
 session.save_handler=qwerty
 error_reporting=0

Modified: php/php-src/branches/PHP_5_3/Zend/tests/bug42819.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug42819.phpt	2012-02-25 12:10:07 UTC (rev 323500)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug42819.phpt	2012-02-25 12:10:41 UTC (rev 323501)
@@ -1,7 +1,7 @@
 --TEST--
 Bug #42819 (namespaces in indexes of constant arrays)
 --SKIPIF--
-?php if (!extension_loaded(spl)) print skip; ?
+?php if (!extension_loaded(spl)) print skip SPL extension required; ?
 --FILE--
 ?php
 namespace foo\foo;

Modified: php/php-src/branches/PHP_5_3/Zend/tests/bug43918.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug43918.phpt	2012-02-25 12:10:07 UTC (rev 323500)
+++ 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/streams/bug47997.phpt trunk/ext/standard/tests/streams/bug47997.phpt

2012-02-25 Thread Olivier DOUCET
odoucet  Sat, 25 Feb 2012 12:44:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323504

Log:
fix phpt : fopen(data://) requires allow_url_fopen=1

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug47997.phpt
U   php/php-src/trunk/ext/standard/tests/streams/bug47997.phpt

Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug47997.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug47997.phpt   
2012-02-25 12:27:38 UTC (rev 323503)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug47997.phpt   
2012-02-25 12:44:46 UTC (rev 323504)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #47997 (stream_copy_to_stream returns 1 on empty streams)
+--INI--
+allow_url_fopen=1
 --FILE--
 ?php


Modified: php/php-src/trunk/ext/standard/tests/streams/bug47997.phpt
===
--- php/php-src/trunk/ext/standard/tests/streams/bug47997.phpt  2012-02-25 
12:27:38 UTC (rev 323503)
+++ php/php-src/trunk/ext/standard/tests/streams/bug47997.phpt  2012-02-25 
12:44:46 UTC (rev 323504)
@@ -1,5 +1,7 @@
 --TEST--
 Bug #47997 (stream_copy_to_stream returns 1 on empty streams)
+--INI--
+allow_url_fopen=1
 --FILE--
 ?php


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2012-02-25 Thread Nikita Popov
nikicSat, 25 Feb 2012 13:04:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323506

Log:
NEWS for r323330

So cjones doesn't have nightmares :P

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-25 13:03:53 UTC (rev 323505)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-25 13:04:43 UTC (rev 323506)
@@ -26,6 +26,9 @@
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

+- Phar:
+  . Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL 
bytes). (Nikic)
+
 - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/tests/bug61124.phpt branches/PHP_5_4/ext/openssl/tests/bug61124.phpt trunk/ext/openssl/tests/bug61124.phpt

2012-02-25 Thread Olivier DOUCET
odoucet  Sat, 25 Feb 2012 13:27:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323509

Log:
test for bug #61124

Bug: https://bugs.php.net/61124 (Closed) Segmentation fault
  
Changed paths:
A   php/php-src/branches/PHP_5_3/ext/openssl/tests/bug61124.phpt
A   php/php-src/branches/PHP_5_4/ext/openssl/tests/bug61124.phpt
A   php/php-src/trunk/ext/openssl/tests/bug61124.phpt

Added: php/php-src/branches/PHP_5_3/ext/openssl/tests/bug61124.phpt
===
--- php/php-src/branches/PHP_5_3/ext/openssl/tests/bug61124.phpt
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/openssl/tests/bug61124.phpt
2012-02-25 13:27:57 UTC (rev 323509)
@@ -0,0 +1,12 @@
+--TEST--
+Bug #61124: Segmentation fault with openssl_decrypt
+--SKIPIF--
+?php
+if (!extension_loaded(openssl)) die(skip);
+--FILE--
+?php
+var_dump(openssl_decrypt('kzo w2RMExUTYQXW2Xzxmg==', 'aes-128-cbc', 'pass', 
false, 'pass'));
+
+--EXPECTF--
+Warning: openssl_decrypt(): Failed to base64 decode the input in %s on line %s
+bool(false)
\ No newline at end of file

Added: php/php-src/branches/PHP_5_4/ext/openssl/tests/bug61124.phpt
===
--- php/php-src/branches/PHP_5_4/ext/openssl/tests/bug61124.phpt
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/openssl/tests/bug61124.phpt
2012-02-25 13:27:57 UTC (rev 323509)
@@ -0,0 +1,12 @@
+--TEST--
+Bug #61124: Segmentation fault with openssl_decrypt
+--SKIPIF--
+?php
+if (!extension_loaded(openssl)) die(skip);
+--FILE--
+?php
+var_dump(openssl_decrypt('kzo w2RMExUTYQXW2Xzxmg==', 'aes-128-cbc', 'pass', 
false, 'pass'));
+
+--EXPECTF--
+Warning: openssl_decrypt(): Failed to base64 decode the input in %s on line %s
+bool(false)
\ No newline at end of file

Added: php/php-src/trunk/ext/openssl/tests/bug61124.phpt
===
--- php/php-src/trunk/ext/openssl/tests/bug61124.phpt   
(rev 0)
+++ php/php-src/trunk/ext/openssl/tests/bug61124.phpt   2012-02-25 13:27:57 UTC 
(rev 323509)
@@ -0,0 +1,12 @@
+--TEST--
+Bug #61124: Segmentation fault with openssl_decrypt
+--SKIPIF--
+?php
+if (!extension_loaded(openssl)) die(skip);
+--FILE--
+?php
+var_dump(openssl_decrypt('kzo w2RMExUTYQXW2Xzxmg==', 'aes-128-cbc', 'pass', 
false, 'pass'));
+
+--EXPECTF--
+Warning: openssl_decrypt(): Failed to base64 decode the input in %s on line %s
+bool(false)
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/fileinfo/fileinfo.c branches/PHP_5_3/ext/fileinfo/tests/bug61173.phpt trunk/ext/fileinfo/fileinfo.c trunk/ext/fileinfo/tests/bug

2012-02-24 Thread Gustavo André dos Santos Lopes
cataphract   Fri, 24 Feb 2012 10:01:39 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323472

Log:
- Fixed bug #61173 (Unable to detect error from finfo constructor).
- Tidied up NEWS

Bug: https://bugs.php.net/61173 (Feedback) Unable to detect error from finfo 
constructor
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c
A   php/php-src/branches/PHP_5_3/ext/fileinfo/tests/bug61173.phpt
U   php/php-src/trunk/ext/fileinfo/fileinfo.c
A   php/php-src/trunk/ext/fileinfo/tests/bug61173.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-02-24 10:01:32 UTC (rev 323471)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-02-24 10:01:39 UTC (rev 323472)
@@ -1,22 +1,16 @@
 PHPNEWS
 |||
 ?? ??? 2012, PHP 5.3.11
+
 - Core:
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)
-
-- Session:
-  . Fixed bug #60860 (session.save_handler=user without defined function core
-dumps). (Felipe)
-
-- Tidy:
-  . Fixed bug #54682 (tidy null pointer dereference). (Tony, David Soria Parra)
-
-- Core:
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
 (Nikic, Laruence)
-  . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical vars).
-(Laruence)
+  . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
+	(Laruence)
+  . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical
+	vars). (Laruence)
   . Fix bug #60895 (Possible invalid handler usage in windows random
 functions). (Pierre)
   . Fixed bug #60825 (Segfault when running symfony 2 tests).
@@ -25,18 +19,12 @@
 (rui, Gustavo)
   . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry)

+- Fileinfo
+  . Fixed bug #61173 (Unable to detect error from finfo constructor). (Gustavo)
+
 - Firebird Database extension (ibase):
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

-- Streams:
-  . Fixed bug #61115 (stream related segfault on fatal error in
-php_stream_context_link). (Gustavo)
-  . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not detected
-together with the last read). (Gustavo)
-  . Fixed bug #60817 (stream_get_line() reads from stream even when there is
-already sufficient data buffered). stream_get_line() now behaves more like
-fgets(), as is documented. (Gustavo)
-
 - PHP-FPM SAPI:
   . Fixed bug #60811 (php-fpm compilation problem). (rasmus)

@@ -53,10 +41,22 @@
   . Fixed bug #60968 (Late static binding doesn't work with
 ReflectionMethod::invokeArgs()). (Laruence)

-- Array:
-  . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
-(Laruence)
+- Session:
+  . Fixed bug #60860 (session.save_handler=user without defined function core
+dumps). (Felipe)

+- Streams:
+  . Fixed bug #61115 (stream related segfault on fatal error in
+php_stream_context_link). (Gustavo)
+  . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not
+detected together with the last read). (Gustavo)
+  . Fixed bug #60817 (stream_get_line() reads from stream even when there is
+already sufficient data buffered). stream_get_line() now behaves more like
+fgets(), as is documented. (Gustavo)
+
+- Tidy:
+  . Fixed bug #54682 (tidy null pointer dereference). (Tony, David Soria Parra)
+
 - XMLRPC:
   . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)


Modified: php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c
===
--- php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c	2012-02-24 10:01:32 UTC (rev 323471)
+++ php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c	2012-02-24 10:01:39 UTC (rev 323472)
@@ -76,9 +76,9 @@
 	} \
 }

-/* {{{ finfo_objects_dtor
+/* {{{ finfo_objects_free
  */
-static void finfo_objects_dtor(void *object, zend_object_handle handle TSRMLS_DC)
+static void finfo_objects_free(void *object TSRMLS_DC)
 {
 	struct finfo_object *intern = (struct finfo_object *) object;

@@ -108,7 +108,8 @@

 	intern-ptr = NULL;

-	retval.handle = zend_objects_store_put(intern, finfo_objects_dtor, NULL, NULL TSRMLS_CC);
+	retval.handle = zend_objects_store_put(intern, NULL,
+		finfo_objects_free, NULL TSRMLS_CC);
 	retval.handlers = (zend_object_handlers *) finfo_object_handlers;

 	return retval;
@@ -276,6 +277,15 @@
 }
 /* }}} */

+#define FILEINFO_DESTROY_OBJECT(object)			\
+	do {		\
+		if (object) {			\
+			zend_object_store_ctor_failed(object TSRMLS_CC);	\
+			zval_dtor(object);	\
+			

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/streamsfuncs.c branches/PHP_5_3/main/streams/streams.c trunk/ext/standard/streamsfuncs.c trunk/main/streams/streams.c

2012-02-24 Thread Gustavo André dos Santos Lopes
cataphract   Fri, 24 Feb 2012 22:56:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323478

Log:
- Better fix for #61115.
- Fixed resource leak in stream_socket_client().

Bug: https://bugs.php.net/61115 (Closed) Stream related segfault on fatal error 
in php_stream_context_del_link
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c
U   php/php-src/branches/PHP_5_3/main/streams/streams.c
U   php/php-src/trunk/ext/standard/streamsfuncs.c
U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c
===
--- php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c2012-02-24 
20:11:11 UTC (rev 323477)
+++ php/php-src/branches/PHP_5_3/ext/standard/streamsfuncs.c2012-02-24 
22:56:21 UTC (rev 323478)
@@ -106,10 +106,6 @@

context = php_stream_context_from_zval(zcontext, flags  
PHP_FILE_NO_DEFAULT_CONTEXT);

-   if (context) {
-   zend_list_addref(context-rsrc_id);
-   }
-
if (flags  PHP_STREAM_CLIENT_PERSISTENT) {
spprintf(hashkey, 0, stream_socket_client__%s, host);
}

Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c
===
--- php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-02-24 20:11:11 UTC 
(rev 323477)
+++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-02-24 22:56:21 UTC 
(rev 323478)
@@ -320,10 +320,15 @@
int remove_rsrc = 1;
int preserve_handle = close_options  PHP_STREAM_FREE_PRESERVE_HANDLE ? 
1 : 0;
int release_cast = 1;
-   /* on an unclean shutdown, the context may have already been freed (if 
it
-* was created after the stream resource), so don't reference it */
-   php_stream_context *context = CG(unclean_shutdown) ? NULL : 
stream-context;
+   php_stream_context *context = NULL;

+   /* on an resource list destruction, the context, another resource, may 
have
+* already been freed (if it was created after the stream resource), so
+* don't reference it */
+   if (!(close_options  PHP_STREAM_FREE_RSRC_DTOR)) {
+   context = stream-context;
+   }
+
if (stream-flags  PHP_STREAM_FLAG_NO_CLOSE) {
preserve_handle = 1;
}

Modified: php/php-src/trunk/ext/standard/streamsfuncs.c
===
--- php/php-src/trunk/ext/standard/streamsfuncs.c   2012-02-24 20:11:11 UTC 
(rev 323477)
+++ php/php-src/trunk/ext/standard/streamsfuncs.c   2012-02-24 22:56:21 UTC 
(rev 323478)
@@ -106,10 +106,6 @@

context = php_stream_context_from_zval(zcontext, flags  
PHP_FILE_NO_DEFAULT_CONTEXT);

-   if (context) {
-   zend_list_addref(context-rsrc_id);
-   }
-
if (flags  PHP_STREAM_CLIENT_PERSISTENT) {
spprintf(hashkey, 0, stream_socket_client__%s, host);
}

Modified: php/php-src/trunk/main/streams/streams.c
===
--- php/php-src/trunk/main/streams/streams.c2012-02-24 20:11:11 UTC (rev 
323477)
+++ php/php-src/trunk/main/streams/streams.c2012-02-24 22:56:21 UTC (rev 
323478)
@@ -366,10 +366,15 @@
int ret = 1;
int preserve_handle = close_options  PHP_STREAM_FREE_PRESERVE_HANDLE ? 
1 : 0;
int release_cast = 1;
-   /* on an unclean shutdown, the context may have already been freed (if 
it
-* was created after the stream resource), so don't reference it */
-   php_stream_context *context = CG(unclean_shutdown) ? NULL : 
stream-context;
+   php_stream_context *context = NULL;

+   /* on an resource list destruction, the context, another resource, may 
have
+* already been freed (if it was created after the stream resource), so
+* don't reference it */
+   if (!(close_options  PHP_STREAM_FREE_RSRC_DTOR)) {
+   context = stream-context;
+   }
+
if (stream-flags  PHP_STREAM_FLAG_NO_CLOSE) {
preserve_handle = 1;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-24 Thread Xinchen Hui
laruence Sat, 25 Feb 2012 04:36:08 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323489

Log:
Fixed bug #61165 (Segfault - strip_tags())

Bug: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/Zend/zend_API.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-25 03:19:27 UTC (rev 323488)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-25 04:36:08 UTC (rev 323489)
@@ -3,6 +3,7 @@
 ?? ??? 2012, PHP 5.3.11

 - Core:
+  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).

Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
===
--- php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-25 03:19:27 UTC 
(rev 323488)
+++ php/php-src/branches/PHP_5_3/Zend/zend_API.c2012-02-25 04:36:08 UTC 
(rev 323489)
@@ -254,10 +254,15 @@
 static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
 {
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
-   SEPARATE_ZVAL_IF_NOT_REF(arg);
-   if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING 
TSRMLS_CC) == SUCCESS) {
+   zval *obj;
+   ALLOC_ZVAL(obj);
+   MAKE_COPY_ZVAL(arg, obj);
+   if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, IS_STRING 
TSRMLS_CC) == SUCCESS) {
+   zval_ptr_dtor(arg);
+   *arg = obj;
return SUCCESS;
}
+   zval_ptr_dtor(obj);
}
/* Standard PHP objects */
if (Z_OBJ_HT_PP(arg) == std_object_handlers || !Z_OBJ_HANDLER_PP(arg, 
cast_object)) {

Modified: php/php-src/trunk/NEWS
===
--- php/php-src/trunk/NEWS  2012-02-25 03:19:27 UTC (rev 323488)
+++ php/php-src/trunk/NEWS  2012-02-25 04:36:08 UTC (rev 323489)
@@ -6,6 +6,7 @@
   . World domination

 - Core:
+  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
 (Nikic, Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical

Modified: php/php-src/trunk/Zend/zend_API.c
===
--- php/php-src/trunk/Zend/zend_API.c   2012-02-25 03:19:27 UTC (rev 323488)
+++ php/php-src/trunk/Zend/zend_API.c   2012-02-25 04:36:08 UTC (rev 323489)
@@ -262,12 +262,17 @@
 static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int type 
TSRMLS_DC) /* {{{ */
 {
if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
-   SEPARATE_ZVAL_IF_NOT_REF(arg);
-   if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, type 
TSRMLS_CC) == SUCCESS) {
+   zval *obj;
+   ALLOC_ZVAL(obj);
+   MAKE_COPY_ZVAL(arg, obj);
+   if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, type 
TSRMLS_CC) == SUCCESS) {
+   zval_ptr_dtor(arg);
+   *arg = obj;
*pl = Z_STRLEN_PP(arg);
*p = Z_STRVAL_PP(arg);
return SUCCESS;
}
+   zval_ptr_dtor(obj);
}
/* Standard PHP objects */
if (Z_OBJ_HT_PP(arg) == std_object_handlers || !Z_OBJ_HANDLER_PP(arg, 
cast_object)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_API.c trunk/NEWS trunk/Zend/zend_API.c

2012-02-24 Thread Laruence
Dmitry:
   you might want to review this fix.

   let me explain why crash before this fix.

   when doing parse_parameter,  then convert the object to string by
calling the ce-cast_object,

   and passed the same pointer(although there was a separation), to
the cast_object..

   then if __toString method stash $this somewhere, after the
parameters clean up,  the $this pointer will be impending..

   then in the next loop, the return_value will happen used the same adress,,

   then balalala, cause the segfault..

   sorry for my poor english,  and hope I have made myself clearly,
if there is any question , plz write me.

thanks

On Sat, Feb 25, 2012 at 12:36 PM, Xinchen Hui larue...@php.net wrote:
 laruence                                 Sat, 25 Feb 2012 04:36:08 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323489

 Log:
 Fixed bug #61165 (Segfault - strip_tags())

 Bug: https://bugs.php.net/61165 (Assigned) Segfault - strip_tags()

 Changed paths:
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/Zend/zend_API.c
    U   php/php-src/trunk/NEWS
    U   php/php-src/trunk/Zend/zend_API.c

 Modified: php/php-src/branches/PHP_5_3/NEWS
 ===
 --- php/php-src/branches/PHP_5_3/NEWS   2012-02-25 03:19:27 UTC (rev 323488)
 +++ php/php-src/branches/PHP_5_3/NEWS   2012-02-25 04:36:08 UTC (rev 323489)
 @@ -3,6 +3,7 @@
  ?? ??? 2012, PHP 5.3.11

  - Core:
 +  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Improved max_input_vars directive to check nested variables (Dmitry).
   . Fixed bug #61095 (Incorect lexing of 0x00*+NUM). (Etienne)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).

 Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c
 ===
 --- php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-02-25 03:19:27 
 UTC (rev 323488)
 +++ php/php-src/branches/PHP_5_3/Zend/zend_API.c        2012-02-25 04:36:08 
 UTC (rev 323489)
 @@ -254,10 +254,15 @@
  static int parse_arg_object_to_string(zval **arg TSRMLS_DC) /* {{{ */
  {
        if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
 -               SEPARATE_ZVAL_IF_NOT_REF(arg);
 -               if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING 
 TSRMLS_CC) == SUCCESS) {
 +               zval *obj;
 +               ALLOC_ZVAL(obj);
 +               MAKE_COPY_ZVAL(arg, obj);
 +               if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, IS_STRING 
 TSRMLS_CC) == SUCCESS) {
 +                       zval_ptr_dtor(arg);
 +                       *arg = obj;
                        return SUCCESS;
                }
 +               zval_ptr_dtor(obj);
        }
        /* Standard PHP objects */
        if (Z_OBJ_HT_PP(arg) == std_object_handlers || !Z_OBJ_HANDLER_PP(arg, 
 cast_object)) {

 Modified: php/php-src/trunk/NEWS
 ===
 --- php/php-src/trunk/NEWS      2012-02-25 03:19:27 UTC (rev 323488)
 +++ php/php-src/trunk/NEWS      2012-02-25 04:36:08 UTC (rev 323489)
 @@ -6,6 +6,7 @@
   . World domination

  - Core:
 +  . Fixed bug #61165 (Segfault - strip_tags()). (Laruence)
   . Fixed bug #61072 (Memory leak when restoring an exception handler).
     (Nikic, Laruence)
   . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical

 Modified: php/php-src/trunk/Zend/zend_API.c
 ===
 --- php/php-src/trunk/Zend/zend_API.c   2012-02-25 03:19:27 UTC (rev 323488)
 +++ php/php-src/trunk/Zend/zend_API.c   2012-02-25 04:36:08 UTC (rev 323489)
 @@ -262,12 +262,17 @@
  static int parse_arg_object_to_string(zval **arg, char **p, int *pl, int 
 type TSRMLS_DC) /* {{{ */
  {
        if (Z_OBJ_HANDLER_PP(arg, cast_object)) {
 -               SEPARATE_ZVAL_IF_NOT_REF(arg);
 -               if (Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, type 
 TSRMLS_CC) == SUCCESS) {
 +               zval *obj;
 +               ALLOC_ZVAL(obj);
 +               MAKE_COPY_ZVAL(arg, obj);
 +               if (Z_OBJ_HANDLER_P(*arg, cast_object)(*arg, obj, type 
 TSRMLS_CC) == SUCCESS) {
 +                       zval_ptr_dtor(arg);
 +                       *arg = obj;
                        *pl = Z_STRLEN_PP(arg);
                        *p = Z_STRVAL_PP(arg);
                        return SUCCESS;
                }
 +               zval_ptr_dtor(obj);
        }
        /* Standard PHP objects */
        if (Z_OBJ_HT_PP(arg) == std_object_handlers || !Z_OBJ_HANDLER_PP(arg, 
 cast_object)) {


 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/tests/bug61165.phpt trunk/Zend/tests/bug61165.phpt

2012-02-24 Thread Xinchen Hui
laruence Sat, 25 Feb 2012 05:18:40 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323490

Log:
merge test to 5.3, and remove xfail since the bug was fixed

Changed paths:
A   php/php-src/branches/PHP_5_3/Zend/tests/bug61165.phpt
U   php/php-src/trunk/Zend/tests/bug61165.phpt

Added: php/php-src/branches/PHP_5_3/Zend/tests/bug61165.phpt
===
--- php/php-src/branches/PHP_5_3/Zend/tests/bug61165.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/Zend/tests/bug61165.phpt   2012-02-25 
05:18:40 UTC (rev 323490)
@@ -0,0 +1,28 @@
+--TEST--
+Bug #61165 (Segfault - strip_tags())
+--FILE--
+?php
+
+$handler = NULL;
+class T {
+public $_this;
+
+public function __toString() {
+   global $handler;
+   $handler = $this;
+$this-_this = $this; // -- uncoment this
+return 'A';
+}
+}
+
+$t = new T;
+for ($i = 0; $i  3; $i++) {
+strip_tags($t);
+   strip_tags(new T);
+}
+var_dump($handler);
+--EXPECTF--
+object(T)#%d (1) {
+  [_this]=
+  *RECURSION*
+}

Modified: php/php-src/trunk/Zend/tests/bug61165.phpt
===
--- php/php-src/trunk/Zend/tests/bug61165.phpt  2012-02-25 04:36:08 UTC (rev 
323489)
+++ php/php-src/trunk/Zend/tests/bug61165.phpt  2012-02-25 05:18:40 UTC (rev 
323490)
@@ -1,7 +1,5 @@
 --TEST--
 Bug #61165 (Segfault - strip_tags())
---XFAIL--
-#61165 doesn't fix yet
 --FILE--
 ?php


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/openssl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c

2012-02-23 Thread Pierre Joye
hi!

Thanks for applying the patch!

Please add the test case as well.

Btw, did you check with Stas and David about 5.4? Not sure if it is OK
at this stage, but we may need another RC already anyway (commits done
since last RC).

On Thu, Feb 23, 2012 at 2:26 AM, Scott MacVicar scott...@php.net wrote:
 scottmac                                 Thu, 23 Feb 2012 01:26:46 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323440

 Log:
 Fixed bug #61124 (Crash when decoding an invalid base64 encoded string).

 Bug: https://bugs.php.net/61124 (Assigned) Segmentation fault

 Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
    U   php/php-src/branches/PHP_5_4/NEWS
    U   php/php-src/branches/PHP_5_4/ext/openssl/openssl.c
    U   php/php-src/trunk/ext/openssl/openssl.c

 Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
 ===
 --- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2012-02-22 23:42:18 
 UTC (rev 323439)
 +++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2012-02-23 01:26:46 
 UTC (rev 323440)
 @@ -4776,6 +4776,10 @@

        if (!raw_input) {
                base64_str = (char*)php_base64_decode((unsigned char*)data, 
 data_len, base64_str_len);
 +               if (!base64_str) {
 +                       php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed 
 to base64 decode the input);
 +                       RETURN_FALSE;
 +               }
                data_len = base64_str_len;
                data = base64_str;
        }

 Modified: php/php-src/branches/PHP_5_4/NEWS
 ===
 --- php/php-src/branches/PHP_5_4/NEWS   2012-02-22 23:42:18 UTC (rev 323439)
 +++ php/php-src/branches/PHP_5_4/NEWS   2012-02-23 01:26:46 UTC (rev 323440)
 @@ -1,6 +1,9 @@
  PHP                                                                        
 NEWS
  |||
  ?? ??? 2012, PHP 5.4.0 RC 9
 +- OpenSSL:
 +  . Fixed bug #61124 (Crash when decoding an invalid base64 encoded string).
 +    (me at ktamura dot com, Scott)

  15 Feb 2012, PHP 5.4.0 RC 8
  - Core:

 Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c
 ===
 --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c  2012-02-22 23:42:18 
 UTC (rev 323439)
 +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c  2012-02-23 01:26:46 
 UTC (rev 323440)
 @@ -4803,6 +4803,10 @@

        if (!(options  OPENSSL_RAW_DATA)) {
                base64_str = (char*)php_base64_decode((unsigned char*)data, 
 data_len, base64_str_len);
 +               if (!base64_str) {
 +                       php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed 
 to base64 decode the input);
 +                       RETURN_FALSE;
 +               }
                data_len = base64_str_len;
                data = base64_str;
        }

 Modified: php/php-src/trunk/ext/openssl/openssl.c
 ===
 --- php/php-src/trunk/ext/openssl/openssl.c     2012-02-22 23:42:18 UTC (rev 
 323439)
 +++ php/php-src/trunk/ext/openssl/openssl.c     2012-02-23 01:26:46 UTC (rev 
 323440)
 @@ -4799,6 +4799,10 @@

        if (!(options  OPENSSL_RAW_DATA)) {
                base64_str = (char*)php_base64_decode((unsigned char*)data, 
 data_len, base64_str_len);
 +               if (!base64_str) {
 +                       php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed 
 to base64 decode the input);
 +                       RETURN_FALSE;
 +               }
                data_len = base64_str_len;
                data = base64_str;
        }


 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2012-02-23 Thread Christopher Jones
sixd Thu, 23 Feb 2012 19:43:38 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323453

Log:
Relocate orphan line

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-23 18:43:05 UTC (rev 323452)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-23 19:43:38 UTC (rev 323453)
@@ -242,9 +242,9 @@
 - Phar:
   . Fixed bug #60261 (NULL pointer dereference in phar). (Felipe)
   . Fixed bug #60164 (Stubs of a specific length break phar_open_from_fp
+scanning for __HALT_COMPILER). (Ralph Schindler)
   . Fixed bug #53872 (internal corruption of phar). (Hannes)
   . Fixed bug #52013 (Unable to decompress files in a compressed phar). 
(Hannes)
-scanning for __HALT_COMPILER). (Ralph Schindler)

 - PHP-FPM SAPI:
   . Fixed bug #60659 (FPM does not clear auth_user on request accept).

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/phar/phar_object.c trunk/ext/phar/phar_object.c

2012-02-23 Thread Christopher Jones



On 02/18/2012 05:39 AM, Nikita Popov wrote:

nikicSat, 18 Feb 2012 13:39:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323330

Log:
Fix headers generated by phar

sapi_header_line.line_len is the length without null terminator, so one has to
take sizeof - 1. This fixes some test failures as the NUL bytes were causing
warnings.

Needs to be merged to 5.4.


Hi Nikita,

This fix deserves a bug report - which will also help as a reminder
for the 5.4 merge.  And it will also add value to NEWS, since people
will be able to find more information (via the bug report) than you
could put in a one line NEWS entry.

Chris

--
Email: christopher.jo...@oracle.com
Tel:  +1 650 506 8630
Blog:  http://blogs.oracle.com/opal/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/tests/streams/bug61115.phpt branches/PHP_5_3/main/streams/streams.c trunk/ext/standard/tests/streams/bug61115.phpt trun

2012-02-22 Thread Gustavo André dos Santos Lopes
cataphract   Wed, 22 Feb 2012 11:45:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323425

Log:
- Fixed bug #61115 (stream related segfault on fatal error in
  php_stream_context_link).
#run-tests.php is not currently detecting the segfault in the test
#Missing 5.4 merge

Bug: https://bugs.php.net/61115 (Analyzed) Stream related segfault on fatal 
error in php_stream_context_del_link
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115.phpt
U   php/php-src/branches/PHP_5_3/main/streams/streams.c
A   php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt
U   php/php-src/trunk/main/streams/streams.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-22 11:15:49 UTC (rev 323424)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-22 11:45:26 UTC (rev 323425)
@@ -29,6 +29,8 @@
   . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

 - Streams:
+  . Fixed bug #61115 (stream related segfault on fatal error in
+php_stream_context_link). (Gustavo)
   . Further fix for bug #60455 (stream_get_line misbehaves if EOF is not 
detected
 together with the last read). (Gustavo)
   . Fixed bug #60817 (stream_get_line() reads from stream even when there is

Added: php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115.phpt
===
--- php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115.phpt   
2012-02-22 11:45:26 UTC (rev 323425)
@@ -0,0 +1,13 @@
+--TEST--
+Bug #61115: Stream related segfault on fatal error in 
php_stream_context_del_link.
+--FILE--
+?php
+
+$arrayLarge = array_fill(0, 113663, '*');
+
+$resourceFileTemp = fopen('php://temp', 'r+');
+stream_context_set_params($resourceFileTemp, array());
+preg_replace('', function() {}, $resourceFileTemp);
+?
+--EXPECTF--
+Catchable fatal error: Object of class Closure could not be converted to 
string in %s on line %d


Property changes on: 
php/php-src/branches/PHP_5_3/ext/standard/tests/streams/bug61115.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/branches/PHP_5_3/main/streams/streams.c
===
--- php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-02-22 11:15:49 UTC 
(rev 323424)
+++ php/php-src/branches/PHP_5_3/main/streams/streams.c 2012-02-22 11:45:26 UTC 
(rev 323425)
@@ -320,7 +320,9 @@
int remove_rsrc = 1;
int preserve_handle = close_options  PHP_STREAM_FREE_PRESERVE_HANDLE ? 
1 : 0;
int release_cast = 1;
-   php_stream_context *context = stream-context;
+   /* on an unclean shutdown, the context may have already been freed (if 
it
+* was created after the stream resource), so don't reference it */
+   php_stream_context *context = CG(unclean_shutdown) ? NULL : 
stream-context;

if (stream-flags  PHP_STREAM_FLAG_NO_CLOSE) {
preserve_handle = 1;
@@ -374,8 +376,8 @@
}

/* Remove stream from any context link list */
-   if (stream-context  stream-context-links) {
-   php_stream_context_del_link(stream-context, stream);
+   if (context  context-links) {
+   php_stream_context_del_link(context, stream);
}

if (close_options  PHP_STREAM_FREE_CALL_DTOR) {

Added: php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt
===
--- php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt  
(rev 0)
+++ php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt  2012-02-22 
11:45:26 UTC (rev 323425)
@@ -0,0 +1,13 @@
+--TEST--
+Bug #61115: Stream related segfault on fatal error in 
php_stream_context_del_link.
+--FILE--
+?php
+
+$arrayLarge = array_fill(0, 113663, '*');
+
+$resourceFileTemp = fopen('php://temp', 'r+');
+stream_context_set_params($resourceFileTemp, array());
+preg_replace('', function() {}, $resourceFileTemp);
+?
+--EXPECTF--
+Catchable fatal error: Object of class Closure could not be converted to 
string in %s on line %d


Property changes on: php/php-src/trunk/ext/standard/tests/streams/bug61115.phpt
___
Added: svn:keywords
   + Id Rev Revision
Added: svn:eol-style
   + native

Modified: php/php-src/trunk/main/streams/streams.c
===
--- php/php-src/trunk/main/streams/streams.c2012-02-22 11:15:49 UTC (rev 
323424)
+++ 

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2012-02-22 Thread Nikita Popov
nikicWed, 22 Feb 2012 17:21:57 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323432

Log:
NEWS for r323362

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-22 16:14:47 UTC (rev 323431)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-22 17:21:57 UTC (rev 323432)
@@ -60,6 +60,9 @@
 - XMLRPC:
   . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)

+- Zlib:
+  . Fixed bug #61139 (gzopen leaks when specifying invalid mode). (Nikic)
+
 02 Feb 2012, PHP 5.3.10

 - Core:

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/openssl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c

2012-02-22 Thread Scott MacVicar
scottmac Thu, 23 Feb 2012 01:26:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323440

Log:
Fixed bug #61124 (Crash when decoding an invalid base64 encoded string).

Bug: https://bugs.php.net/61124 (Assigned) Segmentation fault
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/openssl/openssl.c
U   php/php-src/trunk/ext/openssl/openssl.c

Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
===
--- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2012-02-22 23:42:18 UTC 
(rev 323439)
+++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2012-02-23 01:26:46 UTC 
(rev 323440)
@@ -4776,6 +4776,10 @@

if (!raw_input) {
base64_str = (char*)php_base64_decode((unsigned char*)data, 
data_len, base64_str_len);
+   if (!base64_str) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to 
base64 decode the input);
+   RETURN_FALSE;
+   }
data_len = base64_str_len;
data = base64_str;
}

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS   2012-02-22 23:42:18 UTC (rev 323439)
+++ php/php-src/branches/PHP_5_4/NEWS   2012-02-23 01:26:46 UTC (rev 323440)
@@ -1,6 +1,9 @@
 PHPNEWS
 |||
 ?? ??? 2012, PHP 5.4.0 RC 9
+- OpenSSL:
+  . Fixed bug #61124 (Crash when decoding an invalid base64 encoded string).
+(me at ktamura dot com, Scott)

 15 Feb 2012, PHP 5.4.0 RC 8
 - Core:

Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c
===
--- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c  2012-02-22 23:42:18 UTC 
(rev 323439)
+++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c  2012-02-23 01:26:46 UTC 
(rev 323440)
@@ -4803,6 +4803,10 @@

if (!(options  OPENSSL_RAW_DATA)) {
base64_str = (char*)php_base64_decode((unsigned char*)data, 
data_len, base64_str_len);
+   if (!base64_str) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to 
base64 decode the input);
+   RETURN_FALSE;
+   }
data_len = base64_str_len;
data = base64_str;
}

Modified: php/php-src/trunk/ext/openssl/openssl.c
===
--- php/php-src/trunk/ext/openssl/openssl.c 2012-02-22 23:42:18 UTC (rev 
323439)
+++ php/php-src/trunk/ext/openssl/openssl.c 2012-02-23 01:26:46 UTC (rev 
323440)
@@ -4799,6 +4799,10 @@

if (!(options  OPENSSL_RAW_DATA)) {
base64_str = (char*)php_base64_decode((unsigned char*)data, 
data_len, base64_str_len);
+   if (!base64_str) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to 
base64 decode the input);
+   RETURN_FALSE;
+   }
data_len = base64_str_len;
data = base64_str;
}

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Makefile.gcov branches/PHP_5_4/Makefile.gcov trunk/Makefile.gcov

2012-02-20 Thread Nuno Lopes
nlopess  Mon, 20 Feb 2012 16:01:34 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323386

Log:
fix race condition in find (it was finding the copied files over and over 
again, and recursing forever)

Changed paths:
U   php/php-src/branches/PHP_5_3/Makefile.gcov
U   php/php-src/branches/PHP_5_4/Makefile.gcov
U   php/php-src/trunk/Makefile.gcov

Modified: php/php-src/branches/PHP_5_3/Makefile.gcov
===
--- php/php-src/branches/PHP_5_3/Makefile.gcov  2012-02-20 15:22:27 UTC (rev 
323385)
+++ php/php-src/branches/PHP_5_3/Makefile.gcov  2012-02-20 16:01:34 UTC (rev 
323386)
@@ -12,7 +12,8 @@
@rm -rf lcov_data/
@$(mkinstalldirs) lcov_data/
@echo
-   -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | 
sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | 
uniq | while read x; do \
+   -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name 
\*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 
's/\.da//g' | uniq` ;\
+   for x in $$files; do \
echo -n . ;\
y=`echo $$x | sed -e 's!\.libs/!!'`; \
dir=lcov_data/`dirname $$x`; \

Modified: php/php-src/branches/PHP_5_4/Makefile.gcov
===
--- php/php-src/branches/PHP_5_4/Makefile.gcov  2012-02-20 15:22:27 UTC (rev 
323385)
+++ php/php-src/branches/PHP_5_4/Makefile.gcov  2012-02-20 16:01:34 UTC (rev 
323386)
@@ -12,7 +12,8 @@
@rm -rf lcov_data/
@$(mkinstalldirs) lcov_data/
@echo
-   -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | 
sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | 
uniq | while read x; do \
+   -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name 
\*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 
's/\.da//g' | uniq` ;\
+   for x in $$files; do \
echo -n . ;\
y=`echo $$x | sed -e 's!\.libs/!!'`; \
dir=lcov_data/`dirname $$x`; \

Modified: php/php-src/trunk/Makefile.gcov
===
--- php/php-src/trunk/Makefile.gcov 2012-02-20 15:22:27 UTC (rev 323385)
+++ php/php-src/trunk/Makefile.gcov 2012-02-20 16:01:34 UTC (rev 323386)
@@ -14,7 +14,8 @@
@rm -rf lcov_data/
@$(mkinstalldirs) lcov_data/
@echo
-   -@find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name \*.h | 
sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 's/\.da//g' | 
$(EGREP) $(LCOV_INCLUDE) | uniq | while read x; do \
+   -@files=`find . -name \*.gcda -o -name \*.gcno -o -name \*.da -o -name 
\*.h | sed -e 's/^\.\///' | sed -e 's/\.gcda//g' -e 's/\.gcno//g' -e 
's/\.da//g' | $(EGREP) $(LCOV_INCLUDE) | uniq` ;\
+   for x in $$files; do \
echo -n . ;\
y=`echo $$x | sed -e 's!\.libs/!!'`; \
dir=lcov_data/`dirname $$x`; \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/sapi/fpm/ php-fpm.conf.in

2012-02-20 Thread Rasmus Lerdorf
rasmus   Mon, 20 Feb 2012 20:29:26 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323395

Log:
Fix bug 61149

Bug: https://bugs.php.net/61149 (Open) access.format directive should be in 
quotation marks
  
Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in   2012-02-20 
18:28:57 UTC (rev 323394)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in   2012-02-20 
20:29:26 UTC (rev 323395)
@@ -399,7 +399,7 @@
 ;  %u: remote user
 ;
 ; Default: %R - %u %t \%m %r\ %s
-;access.format = %R - %u %t %m %r%Q%q %s %f %{mili}d %{kilo}M %C%%
+;access.format = %R - %u %t %m %r%Q%q %s %f %{mili}d %{kilo}M %C%%

 ; The log file for slow requests
 ; Default Value: not set

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-CVS] svn: /php/php-src/branches/PHP_5_3/sapi/fpm/ php-fpm.conf.in

2012-02-20 Thread Hannes Magnusson
On Mon, Feb 20, 2012 at 21:29, Rasmus Lerdorf ras...@php.net wrote:
 rasmus                                   Mon, 20 Feb 2012 20:29:26 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323395

 Log:
 Fix bug 61149

 Bug: https://bugs.php.net/61149 (Open) access.format directive should be in 
 quotation marks

 Changed paths:
    U   php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in

 Modified: php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in
 ===
 --- php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in       2012-02-20 
 18:28:57 UTC (rev 323394)
 +++ php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in       2012-02-20 
 20:29:26 UTC (rev 323395)
 @@ -399,7 +399,7 @@
  ;  %u: remote user
  ;
  ; Default: %R - %u %t \%m %r\ %s
 -;access.format = %R - %u %t %m %r%Q%q %s %f %{mili}d %{kilo}M %C%%
 +;access.format = %R - %u %t %m %r%Q%q %s %f %{mili}d %{kilo}M %C%%

That doesn't look right. Don't the inner  need to be escaped?

-Hannes

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/sapi/fpm/ php-fpm.conf.in

2012-02-20 Thread Rasmus Lerdorf
rasmus   Tue, 21 Feb 2012 00:01:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323396

Log:
Yup, these need to be escaped. Good catch.

Changed paths:
U   php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in

Modified: php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in
===
--- php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in   2012-02-20 
20:29:26 UTC (rev 323395)
+++ php/php-src/branches/PHP_5_3/sapi/fpm/php-fpm.conf.in   2012-02-21 
00:01:19 UTC (rev 323396)
@@ -399,7 +399,7 @@
 ;  %u: remote user
 ;
 ; Default: %R - %u %t \%m %r\ %s
-;access.format = %R - %u %t %m %r%Q%q %s %f %{mili}d %{kilo}M %C%%
+;access.format = %R - %u %t \%m %r%Q%q\ %s %f %{mili}d %{kilo}M %C%%

 ; The log file for slow requests
 ; Default Value: not set

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/zlib/tests/bug61139.phpt branches/PHP_5_3/ext/zlib/zlib_fopen_wrapper.c trunk/ext/zlib/tests/bug61139.phpt trunk/ext/zlib/zlib_fopen_wrapper.c

2012-02-19 Thread Nikita Popov
nikicSun, 19 Feb 2012 14:39:29 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323362

Log:
Fix bug #61139 gzopen leaks when specifying invalid mode

Needs to be merged to 5.4.

Bug: https://bugs.php.net/61139 (Open) gzopen leaks when specifying invalid mode
  
Changed paths:
A   php/php-src/branches/PHP_5_3/ext/zlib/tests/bug61139.phpt
U   php/php-src/branches/PHP_5_3/ext/zlib/zlib_fopen_wrapper.c
A   php/php-src/trunk/ext/zlib/tests/bug61139.phpt
U   php/php-src/trunk/ext/zlib/zlib_fopen_wrapper.c

Added: php/php-src/branches/PHP_5_3/ext/zlib/tests/bug61139.phpt
===
--- php/php-src/branches/PHP_5_3/ext/zlib/tests/bug61139.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/zlib/tests/bug61139.phpt   2012-02-19 
14:39:29 UTC (rev 323362)
@@ -0,0 +1,14 @@
+--TEST--
+Bug #61139 (gzopen leaks when specifying invalid mode)
+--SKIPIF--
+?php
+if (!extension_loaded('zlib')) {
+   die('skip - zlib extension not loaded');
+}
+?
+--FILE--
+?php
+
+gzopen('someFile', 'c');
+--EXPECTF--
+Warning: gzopen(): gzopen failed in %s on line %d

Modified: php/php-src/branches/PHP_5_3/ext/zlib/zlib_fopen_wrapper.c
===
--- php/php-src/branches/PHP_5_3/ext/zlib/zlib_fopen_wrapper.c  2012-02-19 
14:35:47 UTC (rev 323361)
+++ php/php-src/branches/PHP_5_3/ext/zlib/zlib_fopen_wrapper.c  2012-02-19 
14:39:29 UTC (rev 323362)
@@ -109,7 +109,7 @@
 php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char 
*mode, int options,
  char **opened_path, 
php_stream_context *context STREAMS_DC TSRMLS_DC)
 {
-   struct php_gz_stream_data_t *self = {0};
+   struct php_gz_stream_data_t *self;
php_stream *stream = NULL, *innerstream = NULL;

/* sanity check the stream: it can be either read-only or write-only */
@@ -120,8 +120,6 @@
return NULL;
}

-   self = emalloc(sizeof(*self));
-
if (strncasecmp(compress.zlib://, path, 16) == 0) {
path += 16;
} else if (strncasecmp(zlib:, path, 5) == 0) {
@@ -134,32 +132,29 @@
int fd;

if (SUCCESS == php_stream_cast(innerstream, PHP_STREAM_AS_FD, 
(void **) fd, REPORT_ERRORS)) {
-   self-gz_file = gzdopen(dup(fd), mode);
+   self = emalloc(sizeof(*self));
self-stream = innerstream;
-   if (self-gz_file)  {
+   self-gz_file = gzdopen(dup(fd), mode);
+
+   if (self-gz_file) {
stream = 
php_stream_alloc_rel(php_stream_gzio_ops, self, 0, mode);
if (stream) {
stream-flags |= 
PHP_STREAM_FLAG_NO_BUFFER;
return stream;
}
+
gzclose(self-gz_file);
}
+
+   efree(self);
if (options  REPORT_ERRORS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
gzopen failed);
}
-   } else if (innerstream) {
-   php_stream_close(innerstream);
}
-   }

-   if (stream) {
-   php_stream_close(stream);
+   php_stream_close(innerstream);
}
-
-   if (self) {
-   efree(self);
-   }
-
+
return NULL;
 }


Added: php/php-src/trunk/ext/zlib/tests/bug61139.phpt
===
--- php/php-src/trunk/ext/zlib/tests/bug61139.phpt  
(rev 0)
+++ php/php-src/trunk/ext/zlib/tests/bug61139.phpt  2012-02-19 14:39:29 UTC 
(rev 323362)
@@ -0,0 +1,14 @@
+--TEST--
+Bug #61139 (gzopen leaks when specifying invalid mode)
+--SKIPIF--
+?php
+if (!extension_loaded('zlib')) {
+   die('skip - zlib extension not loaded');
+}
+?
+--FILE--
+?php
+
+gzopen('someFile', 'c');
+--EXPECTF--
+Warning: gzopen(): gzopen failed in %s on line %d

Modified: php/php-src/trunk/ext/zlib/zlib_fopen_wrapper.c
===
--- php/php-src/trunk/ext/zlib/zlib_fopen_wrapper.c 2012-02-19 14:35:47 UTC 
(rev 323361)
+++ php/php-src/trunk/ext/zlib/zlib_fopen_wrapper.c 2012-02-19 14:39:29 UTC 
(rev 323362)
@@ -109,7 +109,7 @@
 php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char 
*mode, int options,
  char **opened_path, 
php_stream_context *context STREAMS_DC TSRMLS_DC)
 {
-   struct php_gz_stream_data_t *self = {0};
+   struct php_gz_stream_data_t *self;
php_stream *stream 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/phar/phar_object.c trunk/ext/phar/phar_object.c

2012-02-18 Thread Nikita Popov
nikicSat, 18 Feb 2012 13:39:13 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323330

Log:
Fix headers generated by phar

sapi_header_line.line_len is the length without null terminator, so one has to
take sizeof - 1. This fixes some test failures as the NUL bytes were causing
warnings.

Needs to be merged to 5.4.

Changed paths:
U   php/php-src/branches/PHP_5_3/ext/phar/phar_object.c
U   php/php-src/trunk/ext/phar/phar_object.c

Modified: php/php-src/branches/PHP_5_3/ext/phar/phar_object.c
===
--- php/php-src/branches/PHP_5_3/ext/phar/phar_object.c 2012-02-18 13:14:30 UTC 
(rev 323329)
+++ php/php-src/branches/PHP_5_3/ext/phar/phar_object.c 2012-02-18 13:39:13 UTC 
(rev 323330)
@@ -427,7 +427,7 @@
sapi_header_line ctr = {0};

ctr.response_code = 403;
-   ctr.line_len = sizeof(HTTP/1.0 403 Access Denied);
+   ctr.line_len = sizeof(HTTP/1.0 403 Access Denied)-1;
ctr.line = HTTP/1.0 403 Access Denied;
sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC);
sapi_send_headers(TSRMLS_C);
@@ -452,7 +452,7 @@
}

ctr.response_code = 404;
-   ctr.line_len = sizeof(HTTP/1.0 404 Not Found)+1;
+   ctr.line_len = sizeof(HTTP/1.0 404 Not Found)-1;
ctr.line = HTTP/1.0 404 Not Found;
sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC);
sapi_send_headers(TSRMLS_C);
@@ -891,7 +891,7 @@
char *tmp = NULL, sa = '\0';
sapi_header_line ctr = {0};
ctr.response_code = 301;
-   ctr.line_len = sizeof(HTTP/1.1 301 Moved 
Permanently)+1;
+   ctr.line_len = sizeof(HTTP/1.1 301 Moved 
Permanently)-1;
ctr.line = HTTP/1.1 301 Moved Permanently;
sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC);


Modified: php/php-src/trunk/ext/phar/phar_object.c
===
--- php/php-src/trunk/ext/phar/phar_object.c2012-02-18 13:14:30 UTC (rev 
323329)
+++ php/php-src/trunk/ext/phar/phar_object.c2012-02-18 13:39:13 UTC (rev 
323330)
@@ -428,7 +428,7 @@
sapi_header_line ctr = {0};

ctr.response_code = 403;
-   ctr.line_len = sizeof(HTTP/1.0 403 Access Denied);
+   ctr.line_len = sizeof(HTTP/1.0 403 Access Denied)-1;
ctr.line = HTTP/1.0 403 Access Denied;
sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC);
sapi_send_headers(TSRMLS_C);
@@ -453,7 +453,7 @@
}

ctr.response_code = 404;
-   ctr.line_len = sizeof(HTTP/1.0 404 Not Found)+1;
+   ctr.line_len = sizeof(HTTP/1.0 404 Not Found)-1;
ctr.line = HTTP/1.0 404 Not Found;
sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC);
sapi_send_headers(TSRMLS_C);
@@ -893,7 +893,7 @@
char *tmp = NULL, sa = '\0';
sapi_header_line ctr = {0};
ctr.response_code = 301;
-   ctr.line_len = sizeof(HTTP/1.1 301 Moved 
Permanently)+1;
+   ctr.line_len = sizeof(HTTP/1.1 301 Moved 
Permanently)-1;
ctr.line = HTTP/1.1 301 Moved Permanently;
sapi_header_op(SAPI_HEADER_REPLACE, ctr TSRMLS_CC);


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/xmlrpc/tests/bug61097.phpt branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c trunk/ext/xmlrpc/tests/bug61097.phpt trunk/ext/xmlrpc/xm

2012-02-18 Thread Nikita Popov
nikicSat, 18 Feb 2012 14:58:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323331

Log:
Fix bug #61097 Memory leak in xmlrpc functions copying zvals

Needs to be merged to 5.4.

Bug: https://bugs.php.net/61097 (Assigned) Memory leak in xmlrpc functions 
copying zvals
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
A   php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61097.phpt
U   php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c
A   php/php-src/trunk/ext/xmlrpc/tests/bug61097.phpt
U   php/php-src/trunk/ext/xmlrpc/xmlrpc-epi-php.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-18 13:39:13 UTC (rev 323330)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-18 14:58:19 UTC (rev 323331)
@@ -54,6 +54,9 @@
   . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
 (Laruence)

+- XMLRPC:
+  . Fixed bug #61097 (Memory leak in xmlrpc functions copying zvals). (Nikic)
+
 02 Feb 2012, PHP 5.3.10

 - Core:

Added: php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61097.phpt
===
--- php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61097.phpt 
(rev 0)
+++ php/php-src/branches/PHP_5_3/ext/xmlrpc/tests/bug61097.phpt 2012-02-18 
14:58:19 UTC (rev 323331)
@@ -0,0 +1,16 @@
+--TEST--
+Bug #61097 (Memory leak in xmlrpc functions copying zvals)
+--SKIPIF--
+?php if (!extension_loaded(xmlrpc)) print skip; ?
+--FILE--
+?php
+$server = xmlrpc_server_create();
+
+$method = 'abc';
+xmlrpc_server_register_introspection_callback($server, $method);
+xmlrpc_server_register_method($server, 'abc', $method);
+
+echo 'Done';
+?
+--EXPECT--
+Done

Modified: php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c
===
--- php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c2012-02-18 
13:39:13 UTC (rev 323330)
+++ php/php-src/branches/PHP_5_3/ext/xmlrpc/xmlrpc-epi-php.c2012-02-18 
14:58:19 UTC (rev 323331)
@@ -1043,9 +1043,8 @@
 */
if (XMLRPC_ServerRegisterMethod(server-server_ptr, method_key, 
php_xmlrpc_callback)) {
/* save for later use */
-   MAKE_STD_ZVAL(method_name_save);
-   *method_name_save = **method_name;
-   zval_copy_ctor(method_name_save);
+   ALLOC_ZVAL(method_name_save);
+   MAKE_COPY_ZVAL(method_name, method_name_save);

/* register our php method */
add_zval(server-method_map, method_key, 
method_name_save);
@@ -1073,9 +1072,8 @@

if (type == le_xmlrpc_server) {
/* save for later use */
-   MAKE_STD_ZVAL(method_name_save);
-   *method_name_save = **method_name;
-   zval_copy_ctor(method_name_save);
+   ALLOC_ZVAL(method_name_save);
+   MAKE_COPY_ZVAL(method_name, method_name_save);

/* register our php method */
add_zval(server-introspection_map, NULL, method_name_save);

Added: php/php-src/trunk/ext/xmlrpc/tests/bug61097.phpt
===
--- php/php-src/trunk/ext/xmlrpc/tests/bug61097.phpt
(rev 0)
+++ php/php-src/trunk/ext/xmlrpc/tests/bug61097.phpt2012-02-18 14:58:19 UTC 
(rev 323331)
@@ -0,0 +1,16 @@
+--TEST--
+Bug #61097 (Memory leak in xmlrpc functions copying zvals)
+--SKIPIF--
+?php if (!extension_loaded(xmlrpc)) print skip; ?
+--FILE--
+?php
+$server = xmlrpc_server_create();
+
+$method = 'abc';
+xmlrpc_server_register_introspection_callback($server, $method);
+xmlrpc_server_register_method($server, 'abc', $method);
+
+echo 'Done';
+?
+--EXPECT--
+Done

Modified: php/php-src/trunk/ext/xmlrpc/xmlrpc-epi-php.c
===
--- php/php-src/trunk/ext/xmlrpc/xmlrpc-epi-php.c   2012-02-18 13:39:13 UTC 
(rev 323330)
+++ php/php-src/trunk/ext/xmlrpc/xmlrpc-epi-php.c   2012-02-18 14:58:19 UTC 
(rev 323331)
@@ -1043,9 +1043,8 @@
 */
if (XMLRPC_ServerRegisterMethod(server-server_ptr, method_key, 
php_xmlrpc_callback)) {
/* save for later use */
-   MAKE_STD_ZVAL(method_name_save);
-   *method_name_save = **method_name;
-   zval_copy_ctor(method_name_save);
+   ALLOC_ZVAL(method_name_save);
+   MAKE_COPY_ZVAL(method_name, method_name_save);

/* register our php method */
add_zval(server-method_map, method_key, 
method_name_save);
@@ -1073,9 +1072,8 @@

if (type == 

Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/tests/basic/bug61000.phpt trunk/tests/basic/bug61000.phpt

2012-02-17 Thread Laruence
Hi:

seems to be my fault,, sorry.

thanks for fixing this.


On Fri, Feb 17, 2012 at 1:48 AM, Rasmus Lerdorf ras...@php.net wrote:
 rasmus                                   Thu, 16 Feb 2012 17:48:30 +

 Revision: http://svn.php.net/viewvc?view=revisionrevision=323258

 Log:
 Weird, what happened here?

 Changed paths:
    U   php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt
    U   php/php-src/trunk/tests/basic/bug61000.phpt

 Modified: php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt
 ===
 --- php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt      2012-02-16 
 16:43:04 UTC (rev 323257)
 +++ php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt      2012-02-16 
 17:48:30 UTC (rev 323258)
 @@ -17,22 +17,3 @@
  Array
  (
  )
 ---TEST--
 -Bug #61000 (Exceeding max nesting level doesn't delete numerical vars)
 ---INI--
 -max_input_nesting_level=2
 ---POST--
 -1[a][]=foo1[a][b][c]=bar
 ---GET--
 -a[a][]=fooa[a][b][c]=bar
 ---FILE--
 -?php
 -print_r($_GET);
 -print_r($_POST);
 ---EXPECTF--
 -Array
 -(
 -)
 -Array
 -(
 -)

 Modified: php/php-src/trunk/tests/basic/bug61000.phpt
 ===
 --- php/php-src/trunk/tests/basic/bug61000.phpt 2012-02-16 16:43:04 UTC (rev 
 323257)
 +++ php/php-src/trunk/tests/basic/bug61000.phpt 2012-02-16 17:48:30 UTC (rev 
 323258)
 @@ -17,22 +17,3 @@
  Array
  (
  )
 ---TEST--
 -Bug #61000 (Exceeding max nesting level doesn't delete numerical vars)
 ---INI--
 -max_input_nesting_level=2
 ---POST--
 -1[a][]=foo1[a][b][c]=bar
 ---GET--
 -a[a][]=fooa[a][b][c]=bar
 ---FILE--
 -?php
 -print_r($_GET);
 -print_r($_POST);
 ---EXPECTF--
 -Array
 -(
 -)
 -Array
 -(
 -)


 --
 PHP CVS Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS

2012-02-17 Thread Adam Harvey
aharvey  Sat, 18 Feb 2012 04:32:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323313

Log:
Merge 5.3.10 NEWS, per Ondřej's mailing list prod.

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS   2012-02-18 02:18:45 UTC (rev 323312)
+++ php/php-src/branches/PHP_5_3/NEWS   2012-02-18 04:32:45 UTC (rev 323313)
@@ -54,9 +54,11 @@
   . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX).
 (Laruence)

-?? ??? 2012, PHP 5.3.10
+02 Feb 2012, PHP 5.3.10

-(to be added)
+- Core:
+  . Fixed arbitrary remote code execution vulnerability reported by Stefan
+Esser, CVE-2012-0830. (Stas, Dmitry)

 10 Jan 2012, PHP 5.3.9


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/tests/basic/bug61000.phpt trunk/tests/basic/bug61000.phpt

2012-02-16 Thread Rasmus Lerdorf
rasmus   Thu, 16 Feb 2012 17:48:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323258

Log:
Weird, what happened here?

Changed paths:
U   php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt
U   php/php-src/trunk/tests/basic/bug61000.phpt

Modified: php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt
===
--- php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt  2012-02-16 
16:43:04 UTC (rev 323257)
+++ php/php-src/branches/PHP_5_3/tests/basic/bug61000.phpt  2012-02-16 
17:48:30 UTC (rev 323258)
@@ -17,22 +17,3 @@
 Array
 (
 )
---TEST--
-Bug #61000 (Exceeding max nesting level doesn't delete numerical vars)
---INI--
-max_input_nesting_level=2
---POST--
-1[a][]=foo1[a][b][c]=bar
---GET--
-a[a][]=fooa[a][b][c]=bar
---FILE--
-?php
-print_r($_GET);
-print_r($_POST);
---EXPECTF--
-Array
-(
-)
-Array
-(
-)

Modified: php/php-src/trunk/tests/basic/bug61000.phpt
===
--- php/php-src/trunk/tests/basic/bug61000.phpt 2012-02-16 16:43:04 UTC (rev 
323257)
+++ php/php-src/trunk/tests/basic/bug61000.phpt 2012-02-16 17:48:30 UTC (rev 
323258)
@@ -17,22 +17,3 @@
 Array
 (
 )
---TEST--
-Bug #61000 (Exceeding max nesting level doesn't delete numerical vars)
---INI--
-max_input_nesting_level=2
---POST--
-1[a][]=foo1[a][b][c]=bar
---GET--
-a[a][]=fooa[a][b][c]=bar
---FILE--
-?php
-print_r($_GET);
-print_r($_POST);
---EXPECTF--
-Array
-(
-)
-Array
-(
-)

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/main/php_variables.c branches/PHP_5_3/main/rfc1867.c branches/PHP_5_4/NEWS branches/PHP_5_4/main/php_variables.c branches/PHP_5_4/ma

2012-02-14 Thread Dmitry Stogov
dmitry   Tue, 14 Feb 2012 08:58:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323202

Log:
Improved max_input_vars directive to check nested variables

Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/main/php_variables.c
U   php/php-src/branches/PHP_5_3/main/rfc1867.c
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/main/php_variables.c
U   php/php-src/branches/PHP_5_4/main/rfc1867.c
U   php/php-src/trunk/main/php_variables.c
U   php/php-src/trunk/main/rfc1867.c

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2012-02-14 08:39:15 UTC (rev 323201)
+++ php/php-src/branches/PHP_5_3/NEWS	2012-02-14 08:58:52 UTC (rev 323202)
@@ -1,6 +1,9 @@
 PHPNEWS
 |||
 ?? ??? 2012, PHP 5.3.11
+- Core:
+  . Improved max_input_vars directive to check nested variables (Dmitry).
+
 - Session:
   . Fixed bug #60860 (session.save_handler=user without defined function core
 dumps). (Felipe)

Modified: php/php-src/branches/PHP_5_3/main/php_variables.c
===
--- php/php-src/branches/PHP_5_3/main/php_variables.c	2012-02-14 08:39:15 UTC (rev 323201)
+++ php/php-src/branches/PHP_5_3/main/php_variables.c	2012-02-14 08:58:52 UTC (rev 323202)
@@ -196,21 +196,9 @@
 }
 if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) gpc_element_p) == FAILURE
 	|| Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
-	if (zend_hash_num_elements(symtable1) = PG(max_input_vars)) {
-		if (zend_hash_num_elements(symtable1) == PG(max_input_vars)) {
-			php_error_docref(NULL TSRMLS_CC, E_WARNING, Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini., PG(max_input_vars));
-		}
-		MAKE_STD_ZVAL(gpc_element);
-		array_init(gpc_element);
-		zend_symtable_update(symtable1, escaped_index, index_len + 1, gpc_element, sizeof(zval *), (void **) gpc_element_p);
-	} else {
-		if (index != escaped_index) {
-			efree(escaped_index);
-		}
-		zval_dtor(val);
-		efree(var_orig);
-		return;
-	}
+	MAKE_STD_ZVAL(gpc_element);
+	array_init(gpc_element);
+	zend_symtable_update(symtable1, escaped_index, index_len + 1, gpc_element, sizeof(zval *), (void **) gpc_element_p);
 }
 if (index != escaped_index) {
 	efree(escaped_index);
@@ -255,14 +243,7 @@
 zend_symtable_exists(symtable1, escaped_index, index_len + 1)) {
 zval_ptr_dtor(gpc_element);
 			} else {
-if (zend_hash_num_elements(symtable1) = PG(max_input_vars)) {
-	if (zend_hash_num_elements(symtable1) == PG(max_input_vars)) {
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini., PG(max_input_vars));
-	}
-	zend_symtable_update(symtable1, escaped_index, index_len + 1, gpc_element, sizeof(zval *), (void **) gpc_element_p);
-} else {
-	zval_ptr_dtor(gpc_element);
-}
+zend_symtable_update(symtable1, escaped_index, index_len + 1, gpc_element, sizeof(zval *), (void **) gpc_element_p);
 			}
 			if (escaped_index != index) {
 efree(escaped_index);
@@ -276,6 +257,7 @@
 {
 	char *var, *val, *e, *s, *p;
 	zval *array_ptr = (zval *) arg;
+	long count = 0;

 	if (SG(request_info).post_data == NULL) {
 		return;
@@ -289,6 +271,10 @@
 		if ((val = memchr(s, '=', (p - s { /* have a value */
 			unsigned int val_len, new_val_len;

+			if (++count  PG(max_input_vars)) {
+php_error_docref(NULL TSRMLS_CC, E_WARNING, Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini., PG(max_input_vars));
+return;
+			}
 			var = s;

 			php_url_decode(var, (val - s));
@@ -322,6 +308,7 @@
 	zval *array_ptr;
 	int free_buffer = 0;
 	char *strtok_buf = NULL;
+	long count = 0;

 	switch (arg) {
 		case PARSE_POST:
@@ -411,6 +398,11 @@
 			}
 		}

+		if (++count  PG(max_input_vars)) {
+			php_error_docref(NULL TSRMLS_CC, E_WARNING, Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini., PG(max_input_vars));
+			break;
+		}
+
 		if (val) { /* have a value */
 			int val_len;
 			unsigned int new_val_len;

Modified: php/php-src/branches/PHP_5_3/main/rfc1867.c
===
--- php/php-src/branches/PHP_5_3/main/rfc1867.c	2012-02-14 08:39:15 UTC (rev 323201)
+++ php/php-src/branches/PHP_5_3/main/rfc1867.c	2012-02-14 08:58:52 UTC (rev 323202)
@@ -779,6 +779,7 @@
 	void *event_extra_data = NULL;
 	int llen = 0;
 	int upload_cnt = INI_INT(max_file_uploads);
+	long count = 0;

 	if (SG(post_max_size)  0  

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/tests/basic/022.phpt branches/PHP_5_3/tests/basic/023.phpt branches/PHP_5_3/tests/basic/024.phpt branches/PHP_5_3/tests/basic/027.phpt branches/PHP_5_3/te

2012-02-14 Thread Rasmus Lerdorf
rasmus   Tue, 14 Feb 2012 09:47:32 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323205

Log:
These tests fail unless max_input_vars and/or max_file_uploads is set high 
enough

Changed paths:
U   php/php-src/branches/PHP_5_3/tests/basic/022.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/023.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/024.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/027.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/rfc1867_anonymous_upload.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/rfc1867_array_upload.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/rfc1867_empty_upload.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/rfc1867_max_file_size.phpt
U   php/php-src/branches/PHP_5_3/tests/basic/rfc1867_post_max_filesize.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/022.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/023.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/024.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/027.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/028.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/bug55500.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/rfc1867_anonymous_upload.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/rfc1867_array_upload.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/rfc1867_empty_upload.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/rfc1867_max_file_size.phpt
U   php/php-src/branches/PHP_5_4/tests/basic/rfc1867_post_max_filesize.phpt
U   php/php-src/trunk/tests/basic/022.phpt
U   php/php-src/trunk/tests/basic/023.phpt
U   php/php-src/trunk/tests/basic/024.phpt
U   php/php-src/trunk/tests/basic/027.phpt
U   php/php-src/trunk/tests/basic/028.phpt
U   php/php-src/trunk/tests/basic/bug55500.phpt
U   php/php-src/trunk/tests/basic/rfc1867_anonymous_upload.phpt
U   php/php-src/trunk/tests/basic/rfc1867_array_upload.phpt
U   php/php-src/trunk/tests/basic/rfc1867_empty_upload.phpt
U   php/php-src/trunk/tests/basic/rfc1867_max_file_size.phpt
U   php/php-src/trunk/tests/basic/rfc1867_post_max_filesize.phpt

Modified: php/php-src/branches/PHP_5_3/tests/basic/022.phpt
===
--- php/php-src/branches/PHP_5_3/tests/basic/022.phpt	2012-02-14 09:27:08 UTC (rev 323204)
+++ php/php-src/branches/PHP_5_3/tests/basic/022.phpt	2012-02-14 09:47:32 UTC (rev 323205)
@@ -1,5 +1,7 @@
 --TEST--
 Cookies test#1
+--INI--
+max_input_vars=1000
 --COOKIE--
 cookie1=val1  ; cookie2=val2%20; cookie3=val 3.; cookie 4= value 4 %3B; cookie1=bogus; %20cookie1=ignore;+cookie1=ignore;cookie1;cookie  5=%20 value; cookie%206=þæö;cookie+7=;$cookie.8;cookie-9=1;;;-  % $cookie 10=10
 --FILE--

Modified: php/php-src/branches/PHP_5_3/tests/basic/023.phpt
===
--- php/php-src/branches/PHP_5_3/tests/basic/023.phpt	2012-02-14 09:27:08 UTC (rev 323204)
+++ php/php-src/branches/PHP_5_3/tests/basic/023.phpt	2012-02-14 09:47:32 UTC (rev 323205)
@@ -2,6 +2,7 @@
 Cookies test#2
 --INI--
 magic_quotes_gpc=0
+max_input_vars=1000
 --COOKIE--
 c o o k i e=value; c o o k i e= v a l u e ;;c%20o+o k+i%20e=v;name=value,value,UEhQIQ==;UEhQIQ==foo
 --FILE--

Modified: php/php-src/branches/PHP_5_3/tests/basic/024.phpt
===
--- php/php-src/branches/PHP_5_3/tests/basic/024.phpt	2012-02-14 09:27:08 UTC (rev 323204)
+++ php/php-src/branches/PHP_5_3/tests/basic/024.phpt	2012-02-14 09:47:32 UTC (rev 323205)
@@ -3,6 +3,7 @@
 --INI--
 magic_quotes_gpc=0
 always_populate_raw_post_data=1
+max_input_vars=1000
 --POST--
 a=ABCy=XYZc[]=1c[]=2c[a]=3
 --FILE--

Modified: php/php-src/branches/PHP_5_3/tests/basic/027.phpt
===
--- php/php-src/branches/PHP_5_3/tests/basic/027.phpt	2012-02-14 09:27:08 UTC (rev 323204)
+++ php/php-src/branches/PHP_5_3/tests/basic/027.phpt	2012-02-14 09:47:32 UTC (rev 323205)
@@ -5,6 +5,7 @@
 always_populate_raw_post_data=0
 display_errors=0
 max_input_nesting_level=10
+max_input_vars=1000
 track_errors=1
 log_errors=0
 --POST--

Modified: php/php-src/branches/PHP_5_3/tests/basic/rfc1867_anonymous_upload.phpt
===
--- php/php-src/branches/PHP_5_3/tests/basic/rfc1867_anonymous_upload.phpt	2012-02-14 09:27:08 UTC (rev 323204)
+++ php/php-src/branches/PHP_5_3/tests/basic/rfc1867_anonymous_upload.phpt	2012-02-14 09:47:32 UTC (rev 323205)
@@ -5,6 +5,7 @@
 error_reporting=E_ALL~E_NOTICE
 comment=debug builds show some additional E_NOTICE errors
 upload_max_filesize=1024
+max_file_uploads=10
 --POST_RAW--
 Content-Type: multipart/form-data; boundary=---20896060251896012921717172737
 -20896060251896012921717172737

Modified: 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic3.phpt branches/PHP_5_4/ext/standard/tests/strings/parse_str_basic3.phpt trunk/ext/standard/tests/strings/parse_

2012-02-14 Thread Rasmus Lerdorf
rasmus   Tue, 14 Feb 2012 09:50:46 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323206

Log:
This one depends on max_input_vars as well

Changed paths:
U   
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic3.phpt
U   
php/php-src/branches/PHP_5_4/ext/standard/tests/strings/parse_str_basic3.phpt
U   php/php-src/trunk/ext/standard/tests/strings/parse_str_basic3.phpt

Modified: 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic3.phpt
===
--- 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic3.phpt   
2012-02-14 09:47:32 UTC (rev 323205)
+++ 
php/php-src/branches/PHP_5_3/ext/standard/tests/strings/parse_str_basic3.phpt   
2012-02-14 09:50:46 UTC (rev 323206)
@@ -2,6 +2,7 @@
 Test parse_str() function : basic functionality
 --INI--
 magic_quotes_gpc = on
+max_input_vars=1000
 --FILE--
 ?php
 /* Prototype  : void parse_str  ( string $str  [, array $arr  ] )

Modified: 
php/php-src/branches/PHP_5_4/ext/standard/tests/strings/parse_str_basic3.phpt
===
--- 
php/php-src/branches/PHP_5_4/ext/standard/tests/strings/parse_str_basic3.phpt   
2012-02-14 09:47:32 UTC (rev 323205)
+++ 
php/php-src/branches/PHP_5_4/ext/standard/tests/strings/parse_str_basic3.phpt   
2012-02-14 09:50:46 UTC (rev 323206)
@@ -1,5 +1,7 @@
 --TEST--
 Test parse_str() function : basic functionality
+--INI--
+max_input_vars=1000
 --FILE--
 ?php
 /* Prototype  : void parse_str  ( string $str  [, array $arr  ] )

Modified: php/php-src/trunk/ext/standard/tests/strings/parse_str_basic3.phpt
===
--- php/php-src/trunk/ext/standard/tests/strings/parse_str_basic3.phpt  
2012-02-14 09:47:32 UTC (rev 323205)
+++ php/php-src/trunk/ext/standard/tests/strings/parse_str_basic3.phpt  
2012-02-14 09:50:46 UTC (rev 323206)
@@ -1,5 +1,7 @@
 --TEST--
 Test parse_str() function : basic functionality
+--INI--
+max_input_vars=100
 --FILE--
 ?php
 /* Prototype  : void parse_str  ( string $str  [, array $arr  ] )

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/main/streams/plain_wrapper.c trunk/main/streams/plain_wrapper.c

2012-02-14 Thread Mateusz Kocielski
shm  Tue, 14 Feb 2012 14:14:30 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=323213

Log:
* fixed bug #60704 unlink() bug with some files path

Reviewed by: rasmus@

Bug: https://bugs.php.net/60704 (Assigned) unlink() bug with some files path
  
Changed paths:
U   php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c
U   php/php-src/trunk/main/streams/plain_wrapper.c

Modified: php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c
===
--- php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c   2012-02-14 
13:31:23 UTC (rev 323212)
+++ php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c   2012-02-14 
14:14:30 UTC (rev 323213)
@@ -1010,9 +1010,12 @@

 static int php_plain_files_url_stater(php_stream_wrapper *wrapper, char *url, 
int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
 {
+   char *p;

-   if (strncmp(url, file://, sizeof(file://) - 1) == 0) {
-   url += sizeof(file://) - 1;
+   if ((p = strstr(url, ://)) != NULL) {
+   if (p  strchr(url, '/')) {
+   url = p + 3;
+   }
}

if (PG(safe_mode) (!php_checkuid_ex(url, NULL, 
CHECKUID_CHECK_FILE_AND_DIR, (flags  PHP_STREAM_URL_STAT_QUIET) ? 
CHECKUID_NO_ERRORS : 0))) {
@@ -1045,7 +1048,9 @@
int ret;

if ((p = strstr(url, ://)) != NULL) {
-   url = p + 3;
+   if (p  strchr(url, '/')) {
+   url = p + 3;
+   }
}

if (options  ENFORCE_SAFE_MODE) {
@@ -1093,11 +1098,15 @@
 #endif

if ((p = strstr(url_from, ://)) != NULL) {
-   url_from = p + 3;
+   if (p  strchr(url_from, '/')) {
+   url_from = p + 3;
+   }
}

if ((p = strstr(url_to, ://)) != NULL) {
-   url_to = p + 3;
+   if (p  strchr(url_to, '/')) {
+   url_to = p + 3;
+   }
}

if (PG(safe_mode)  (!php_checkuid(url_from, NULL, 
CHECKUID_CHECK_FILE_AND_DIR) ||
@@ -1168,7 +1177,9 @@
char *p;

if ((p = strstr(dir, ://)) != NULL) {
-   dir = p + 3;
+   if (p  strchr(dir, '/')) {
+   dir = p + 3;
+   }
}

if (!recursive) {

Modified: php/php-src/trunk/main/streams/plain_wrapper.c
===
--- php/php-src/trunk/main/streams/plain_wrapper.c  2012-02-14 13:31:23 UTC 
(rev 323212)
+++ php/php-src/trunk/main/streams/plain_wrapper.c  2012-02-14 14:14:30 UTC 
(rev 323213)
@@ -1001,9 +1001,12 @@

 static int php_plain_files_url_stater(php_stream_wrapper *wrapper, char *url, 
int flags, php_stream_statbuf *ssb, php_stream_context *context TSRMLS_DC)
 {
+   char *p;

-   if (strncmp(url, file://, sizeof(file://) - 1) == 0) {
-   url += sizeof(file://) - 1;
+   if ((p = strstr(url, ://)) != NULL) {
+   if (p  strchr(url, '/')) {
+   url = p + 3;
+   }
}

if (php_check_open_basedir_ex(url, (flags  PHP_STREAM_URL_STAT_QUIET) 
? 0 : 1 TSRMLS_CC)) {
@@ -1032,7 +1035,9 @@
int ret;

if ((p = strstr(url, ://)) != NULL) {
-   url = p + 3;
+   if (p  strchr(url, '/')) {
+   url = p + 3;
+   }
}

if (php_check_open_basedir(url TSRMLS_CC)) {
@@ -1074,11 +1079,15 @@
 #endif

if ((p = strstr(url_from, ://)) != NULL) {
-   url_from = p + 3;
+   if (p  strchr(url_from, '/')) {
+   url_from = p + 3;
+   }
}

if ((p = strstr(url_to, ://)) != NULL) {
-   url_to = p + 3;
+   if (p  strchr(url_to, '/')) {
+   url_to = p + 3;
+   }
}

if (php_check_open_basedir(url_from TSRMLS_CC) || 
php_check_open_basedir(url_to TSRMLS_CC)) {
@@ -1144,7 +1153,9 @@
char *p;

if ((p = strstr(dir, ://)) != NULL) {
-   dir = p + 3;
+   if (p  strchr(dir, '/')) {
+   dir = p + 3;
+   }
}

if (!recursive) {
@@ -1273,7 +1284,9 @@
 #endif

if ((p = strstr(url, ://)) != NULL) {
-   url = p + 3;
+   if (p  strchr(url, '/')) {
+   url = p + 3;
+   }
}

if (php_check_open_basedir(url TSRMLS_CC)) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

  1   2   3   4   5   6   7   8   9   10   >