[PHP-CVS] svn: /SVNROOT/ commit-email.php

2009-08-18 Thread Gwynne Raskind
gwynne   Tue, 18 Aug 2009 07:38:47 +

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

Log:
Jani is now CC'd on bugtracker commits, per Jani's request

Changed paths:
U   SVNROOT/commit-email.php

Modified: SVNROOT/commit-email.php
===
--- SVNROOT/commit-email.php2009-08-18 05:37:08 UTC (rev 287437)
+++ SVNROOT/commit-email.php2009-08-18 07:38:47 UTC (rev 287438)
@@ -76,6 +76,7 @@
 '|^pear/pearweb|' = array('pear-...@lists.php.net', 
'pear-c...@lists.php.net'),
 '|^pear/peardoc|' = array('pear-...@lists.php.net'),
 '|^pear/pear-core|' = array('pear-...@lists.php.net', 
'pear-c...@lists.php.net'),
+'|^pear/packages/Bugtracker|' = array('pear-...@lists.php.net', 
'pear-c...@lists.php.net', 'j...@php.net'),
 '|^pear/packages/installphars|' = array('pear-c...@lists.php.net'),
 '|^pear/packages|' = array('pear-...@lists.php.net'),
 '|^pear/ci|' = array('pear-...@lists.php.net'),

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

[PHP-CVS] svn: /SVNROOT/ commit-email.php

2009-08-18 Thread Gwynne Raskind
gwynne   Tue, 18 Aug 2009 07:51:41 +

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

Log:
change commit email envelope sender, per bjori's request

Changed paths:
U   SVNROOT/commit-email.php

Modified: SVNROOT/commit-email.php
===
--- SVNROOT/commit-email.php2009-08-18 07:38:47 UTC (rev 287438)
+++ SVNROOT/commit-email.php2009-08-18 07:51:41 UTC (rev 287439)
@@ -7,6 +7,7 @@
 // Constants
 $smtp_server = '127.0.0.1';

+$envelope_sender = 'nore...@php.net'; // this-will-bou...@php.net
 $commit_email_list = array(
 // FastCGI ISAPI
 '|^php/fastcgi-isapi|' = array('sh...@php.net', 'w...@php.net', 
'ed...@php.net'),
@@ -234,7 +235,7 @@
 $rcpt_commands = RCPT TO: . implode(\r\nRCPT TO:, $smtp_recipients) . 
;
 fwrite($socket, SMTP
 EHLO localhost\r
-MAIL FROM:this-will-bou...@php.net BODY=8BITMIME\r
+MAIL FROM:{$envelope_sender} BODY=8BITMIME\r
 {$rcpt_commands}\r
 DATA\r
 {$msg_body}\r

-- 
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_execute.h branches/PHP_5_3/Zend/zend_vm_def.h branches/PHP_5_3/Zend/zend_vm_execute.h trunk/Zend/zend_execute.h trunk/Zend/zend_vm_def.h trunk/Z

2009-08-18 Thread Dmitry Stogov
dmitry   Tue, 18 Aug 2009 10:12:32 +

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

Log:
Fixed ability to call user functions from user opcodes without recursion

Changed paths:
U   php/php-src/branches/PHP_5_3/Zend/zend_execute.h
U   php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h
U   php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h
U   php/php-src/trunk/Zend/zend_execute.h
U   php/php-src/trunk/Zend/zend_vm_def.h
U   php/php-src/trunk/Zend/zend_vm_execute.h

Modified: php/php-src/branches/PHP_5_3/Zend/zend_execute.h
===
--- php/php-src/branches/PHP_5_3/Zend/zend_execute.h2009-08-18 09:45:17 UTC 
(rev 287442)
+++ php/php-src/branches/PHP_5_3/Zend/zend_execute.h2009-08-18 10:12:32 UTC 
(rev 287443)
@@ -351,6 +351,8 @@
 #define ZEND_USER_OPCODE_CONTINUE   0 /* execute next opcode */
 #define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from 
function) */
 #define ZEND_USER_OPCODE_DISPATCH   2 /* call original opcode handler */
+#define ZEND_USER_OPCODE_ENTER  3 /* enter into new op_array without 
recursion */
+#define ZEND_USER_OPCODE_LEAVE  4 /* return to calling op_array within the 
same executor */

 #define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of 
returned opcode */


Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h
===
--- php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h 2009-08-18 09:45:17 UTC 
(rev 287442)
+++ php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h 2009-08-18 10:12:32 UTC 
(rev 287443)
@@ -2328,16 +2328,12 @@
EX_T(opline-result.u.var).var.fcall_returned_reference 
= EX(function_state).function-common.return_reference;
}

-#ifndef ZEND_VM_EXPORT
if (zend_execute == execute  !EG(exception)) {
EX(call_opline) = opline;
ZEND_VM_ENTER();
} else {
zend_execute(EG(active_op_array) TSRMLS_CC);
}
-#else
-   zend_execute(EG(active_op_array) TSRMLS_CC);
-#endif

EG(opline_ptr) = EX(opline);
EG(active_op_array) = EX(op_array);
@@ -4358,6 +4354,10 @@
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
+   case ZEND_USER_OPCODE_ENTER:
+   ZEND_VM_ENTER();
+   case ZEND_USER_OPCODE_LEAVE:
+   ZEND_VM_LEAVE();
case ZEND_USER_OPCODE_DISPATCH:
ZEND_VM_DISPATCH(EX(opline)-opcode, EX(opline));
default:

Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h
===
--- php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-08-18 09:45:17 UTC 
(rev 287442)
+++ php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-08-18 10:12:32 UTC 
(rev 287443)
@@ -330,16 +330,12 @@
EX_T(opline-result.u.var).var.fcall_returned_reference 
= EX(function_state).function-common.return_reference;
}

-#if 1
if (zend_execute == execute  !EG(exception)) {
EX(call_opline) = opline;
ZEND_VM_ENTER();
} else {
zend_execute(EG(active_op_array) TSRMLS_CC);
}
-#else
-   zend_execute(EG(active_op_array) TSRMLS_CC);
-#endif

EG(opline_ptr) = EX(opline);
EG(active_op_array) = EX(op_array);
@@ -699,6 +695,10 @@
ZEND_VM_CONTINUE();
case ZEND_USER_OPCODE_RETURN:
return 
zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+   case ZEND_USER_OPCODE_ENTER:
+   ZEND_VM_ENTER();
+   case ZEND_USER_OPCODE_LEAVE:
+   ZEND_VM_LEAVE();
case ZEND_USER_OPCODE_DISPATCH:
ZEND_VM_DISPATCH(EX(opline)-opcode, EX(opline));
default:

Modified: php/php-src/trunk/Zend/zend_execute.h
===
--- php/php-src/trunk/Zend/zend_execute.h   2009-08-18 09:45:17 UTC (rev 
287442)
+++ php/php-src/trunk/Zend/zend_execute.h   2009-08-18 10:12:32 UTC (rev 
287443)
@@ -372,6 +372,8 @@
 #define ZEND_USER_OPCODE_CONTINUE   0 /* execute next opcode */
 #define ZEND_USER_OPCODE_RETURN 1 /* exit from executor (return from 
function) */
 #define ZEND_USER_OPCODE_DISPATCH   2 /* call original opcode handler */
+#define ZEND_USER_OPCODE_ENTER  3 /* enter into new op_array without 
recursion */
+#define ZEND_USER_OPCODE_LEAVE  4 /* return to calling 

[PHP-CVS] svn: /SVNROOT/ commit-email.php

2009-08-18 Thread Gwynne Raskind
gwynne   Tue, 18 Aug 2009 10:17:41 +

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

Log:
the envelope sender seems to trigger some particular configuration in the lists 
MX; reverting it to its former value for now

Changed paths:
U   SVNROOT/commit-email.php

Modified: SVNROOT/commit-email.php
===
--- SVNROOT/commit-email.php2009-08-18 10:12:32 UTC (rev 287443)
+++ SVNROOT/commit-email.php2009-08-18 10:17:41 UTC (rev 287444)
@@ -7,7 +7,7 @@
 // Constants
 $smtp_server = '127.0.0.1';

-$envelope_sender = 'nore...@php.net'; // this-will-bou...@php.net
+$envelope_sender = 'this-will-bou...@php.net'; // 'nore...@php.net';
 $commit_email_list = array(
 // FastCGI ISAPI
 '|^php/fastcgi-isapi|' = array('sh...@php.net', 'w...@php.net', 
'ed...@php.net'),

-- 
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/zend_execute.h branches/PHP_5_3/Zend/zend_vm_def.h branches/PHP_5_3/Zend/zend_vm_execute.h trunk/Zend/zend_execute.h trunk/Zend/zend_vm_def.h tru

2009-08-18 Thread Derick Rethans
On Tue, 18 Aug 2009, Dmitry Stogov wrote:

 dmitry   Tue, 18 Aug 2009 10:12:32 +
 
 Revision: http://svn.php.net/viewvc?view=revisionrevision=287443
 
 Log:
 Fixed ability to call user functions from user opcodes without recursion

Would you have some example on how this is supposed to work? It'd be an 
awesome addition to docs...

regards,
Derick

-- 
http://derickrethans.nl | http://ezcomponents.org | http://xdebug.org
twitter: @derickr

-- 
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_2/ext/ldap/ldap.c branches/PHP_5_3/ext/ldap/ldap.c trunk/ext/ldap/ldap.c

2009-08-18 Thread Ilia Alshanetsky
iliaaTue, 18 Aug 2009 12:44:32 +

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

Log:
NULL the value after free

Changed paths:
U   php/php-src/branches/PHP_5_2/ext/ldap/ldap.c
U   php/php-src/branches/PHP_5_3/ext/ldap/ldap.c
U   php/php-src/trunk/ext/ldap/ldap.c

Modified: php/php-src/branches/PHP_5_2/ext/ldap/ldap.c
===
--- php/php-src/branches/PHP_5_2/ext/ldap/ldap.c2009-08-18 11:50:24 UTC 
(rev 287449)
+++ php/php-src/branches/PHP_5_2/ext/ldap/ldap.c2009-08-18 12:44:32 UTC 
(rev 287450)
@@ -221,6 +221,7 @@

if (entry-ber != NULL) {
ber_free(entry-ber, 0);
+   entry-ber = NULL;
}
zend_list_delete(entry-id);
efree(entry);

Modified: php/php-src/branches/PHP_5_3/ext/ldap/ldap.c
===
--- php/php-src/branches/PHP_5_3/ext/ldap/ldap.c2009-08-18 11:50:24 UTC 
(rev 287449)
+++ php/php-src/branches/PHP_5_3/ext/ldap/ldap.c2009-08-18 12:44:32 UTC 
(rev 287450)
@@ -117,6 +117,7 @@

if (entry-ber != NULL) {
ber_free(entry-ber, 0);
+   entry-ber = NULL;
}
zend_list_delete(entry-id);
efree(entry);

Modified: php/php-src/trunk/ext/ldap/ldap.c
===
--- php/php-src/trunk/ext/ldap/ldap.c   2009-08-18 11:50:24 UTC (rev 287449)
+++ php/php-src/trunk/ext/ldap/ldap.c   2009-08-18 12:44:32 UTC (rev 287450)
@@ -118,6 +118,7 @@

if (entry-ber != NULL) {
ber_free(entry-ber, 0);
+   entry-ber = NULL;
}
zend_list_delete(entry-id);
efree(entry);

-- 
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

2009-08-18 Thread Garrett Serack
garretts Tue, 18 Aug 2009 14:38:41 +

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

Log:
added missing NEWS entry for bug #49223

Bug: http://bugs.php.net/49223 (Closed) Inconsistency using 
get_defined_constants(true)
  
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   2009-08-18 14:08:03 UTC (rev 287454)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-08-18 14:38:41 UTC (rev 287455)
@@ -1,6 +1,9 @@
 PHPNEWS
 |||
 ?? ??? 2009, PHP 5.3.1
+
+- Fix for bug #49223 Inconsistency using get_defined_constants (Garrett)
+
 - Upgraded bundled sqlite to version 3.6.17. (Scott)

 - Added missing sanity checks around exif processing. (Ilia)

-- 
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

2009-08-18 Thread Pierre-Alain Joye
pajoye   Tue, 18 Aug 2009 15:18:50 +

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

Log:
- fix NEWS

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   2009-08-18 14:40:13 UTC (rev 287456)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-08-18 15:18:50 UTC (rev 287457)
@@ -2,8 +2,6 @@
 |||
 ?? ??? 2009, PHP 5.3.1

-- Fix for bug #49223 Inconsistency using get_defined_constants (Garrett)
-
 - Upgraded bundled sqlite to version 3.6.17. (Scott)

 - Added missing sanity checks around exif processing. (Ilia)
@@ -28,6 +26,7 @@
 - Fixed bug #49269 (Ternary operator fails on Iterator object when used inside
   foreach declaration). (Etienne, Dmitry)
 - Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani)
+- Fixed bug #49223 (Inconsistency using get_defined_constants). (Garrett)
 - Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies
   wrong type in declaration). (Ilia)
 - Fixed bug #49183 (dns_get_record does not return NAPTR records). (Pierre)

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

[PHP-CVS] svn: /php/win-installer/trunk/ PHPInstallerBase52.wxs PHPInstallerBase52NTS.wxs PHPInstallerBase53.wxs PHPInstallerBase53NTS.wxs PHPInstallerBase60.wxs PHPInstallerBase60NTS.wxs

2009-08-18 Thread John Mertic
jmertic  Tue, 18 Aug 2009 17:30:02 +

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

Log:
Point the error_log file to the Windows temp directory rather than the User's 
temp directory.

Changed paths:
U   php/win-installer/trunk/PHPInstallerBase52.wxs
U   php/win-installer/trunk/PHPInstallerBase52NTS.wxs
U   php/win-installer/trunk/PHPInstallerBase53.wxs
U   php/win-installer/trunk/PHPInstallerBase53NTS.wxs
U   php/win-installer/trunk/PHPInstallerBase60.wxs
U   php/win-installer/trunk/PHPInstallerBase60NTS.wxs

Modified: php/win-installer/trunk/PHPInstallerBase52.wxs
===
--- php/win-installer/trunk/PHPInstallerBase52.wxs  2009-08-18 16:11:58 UTC 
(rev 287459)
+++ php/win-installer/trunk/PHPInstallerBase52.wxs  2009-08-18 17:30:02 UTC 
(rev 287460)
@@ -302,7 +302,7 @@
  Section=PHP Value=On /
IniFile Id=errorlogINI Action=addLine
  Key=error_log Directory=INSTALLDIR Name=php.ini
- Section=PHP Value=quot;[TempFolder]\php-errors.logquot; /
+ Section=PHP Value=quot;[%windir]\temp\php-errors.logquot; /
  /Component
   Component Id=php5tsDLL
 DiskId=1

Modified: php/win-installer/trunk/PHPInstallerBase52NTS.wxs
===
--- php/win-installer/trunk/PHPInstallerBase52NTS.wxs   2009-08-18 16:11:58 UTC 
(rev 287459)
+++ php/win-installer/trunk/PHPInstallerBase52NTS.wxs   2009-08-18 17:30:02 UTC 
(rev 287460)
@@ -280,7 +280,7 @@
  Section=PHP Value=On /
IniFile Id=errorlogINI Action=addLine
  Key=error_log Directory=INSTALLDIR Name=php.ini
- Section=PHP Value=quot;[TempFolder]\php-errors.logquot; /
+ Section=PHP Value=quot;[%windir]\temp\php-errors.logquot; /
  /Component
   Component Id=php5DLL
 DiskId=1

Modified: php/win-installer/trunk/PHPInstallerBase53.wxs
===
--- php/win-installer/trunk/PHPInstallerBase53.wxs  2009-08-18 16:11:58 UTC 
(rev 287459)
+++ php/win-installer/trunk/PHPInstallerBase53.wxs  2009-08-18 17:30:02 UTC 
(rev 287460)
@@ -295,7 +295,7 @@
  Section=PHP Value=On /
IniFile Id=errorlogINI Action=addLine
  Key=error_log Directory=INSTALLDIR Name=php.ini
- Section=PHP Value=quot;[TempFolder]\php-errors.logquot; /
+ Section=PHP Value=quot;[%windir]\temp\php-errors.logquot; /
  /Component
   Component Id=php5tsDLL
 DiskId=1

Modified: php/win-installer/trunk/PHPInstallerBase53NTS.wxs
===
--- php/win-installer/trunk/PHPInstallerBase53NTS.wxs   2009-08-18 16:11:58 UTC 
(rev 287459)
+++ php/win-installer/trunk/PHPInstallerBase53NTS.wxs   2009-08-18 17:30:02 UTC 
(rev 287460)
@@ -273,7 +273,7 @@
  Section=PHP Value=On /
IniFile Id=errorlogINI Action=addLine
  Key=error_log Directory=INSTALLDIR Name=php.ini
- Section=PHP Value=quot;[TempFolder]\php-errors.logquot; /
+ Section=PHP Value=quot;[%windir]\temp\php-errors.logquot; /
  /Component
   Component Id=php5DLL
 DiskId=1

Modified: php/win-installer/trunk/PHPInstallerBase60.wxs
===
--- php/win-installer/trunk/PHPInstallerBase60.wxs  2009-08-18 16:11:58 UTC 
(rev 287459)
+++ php/win-installer/trunk/PHPInstallerBase60.wxs  2009-08-18 17:30:02 UTC 
(rev 287460)
@@ -295,7 +295,7 @@
  Section=PHP Value=On /
IniFile Id=errorlogINI Action=addLine
  Key=error_log Directory=INSTALLDIR Name=php.ini
- Section=PHP Value=quot;[TempFolder]\php-errors.logquot; /
+ Section=PHP Value=quot;[%windir]\temp\php-errors.logquot; /
  /Component
   Component Id=php6tsDLL
 DiskId=1

Modified: php/win-installer/trunk/PHPInstallerBase60NTS.wxs
===
--- php/win-installer/trunk/PHPInstallerBase60NTS.wxs   2009-08-18 16:11:58 UTC 
(rev 287459)
+++ php/win-installer/trunk/PHPInstallerBase60NTS.wxs   2009-08-18 17:30:02 UTC 
(rev 287460)
@@ -273,7 +273,7 @@
  Section=PHP Value=On /
IniFile Id=errorlogINI Action=addLine
  Key=error_log Directory=INSTALLDIR Name=php.ini
- Section=PHP Value=quot;[TempFolder]\php-errors.logquot; /
+ Section=PHP Value=quot;[%windir]\temp\php-errors.logquot; /
  /Component
  Component Id=php6DLL
 DiskId=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_2/NEWS branches/PHP_5_2/win32/sendmail.c branches/PHP_5_3/NEWS branches/PHP_5_3/win32/sendmail.c trunk/win32/sendmail.c

2009-08-18 Thread Garrett Serack
garretts Tue, 18 Aug 2009 18:58:33 +

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

Log:
- Fixed bug #28038 (Sent incorrect RCPT TO commands to SMTP server)

Bug: http://bugs.php.net/28038 (Closed) Sent incorrect RCPT TO commands to SMTP 
server
  
Changed paths:
U   php/php-src/branches/PHP_5_2/NEWS
U   php/php-src/branches/PHP_5_2/win32/sendmail.c
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/win32/sendmail.c
U   php/php-src/trunk/win32/sendmail.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===
--- php/php-src/branches/PHP_5_2/NEWS	2009-08-18 18:28:59 UTC (rev 287461)
+++ php/php-src/branches/PHP_5_2/NEWS	2009-08-18 18:58:33 UTC (rev 287462)
@@ -8,6 +8,7 @@
 - Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani)
 - Fixed bug #49144 (Import of schema from different host transmits original
   authentication details). (Dmitry)
+- Fixed bug #28038  (Sent incorrect RCPT TO commands to SMTP server) (Garrett)


 13 Aug 2009, PHP 5.2.11RC1

Modified: php/php-src/branches/PHP_5_2/win32/sendmail.c
===
--- php/php-src/branches/PHP_5_2/win32/sendmail.c	2009-08-18 18:28:59 UTC (rev 287461)
+++ php/php-src/branches/PHP_5_2/win32/sendmail.c	2009-08-18 18:58:33 UTC (rev 287462)
@@ -421,7 +421,7 @@
 	}

 	SMTP_SKIP_SPACE(RPath);
-	snprintf(Buffer, MAIL_BUFFER_SIZE, MAIL FROM:%s\r\n, RPath);
+	FormatEmailAddress(Buffer, RPath, MAIL FROM:%s\r\n);
 	if ((res = Post(Buffer)) != SUCCESS) {
 		return (res);
 	}
@@ -436,7 +436,7 @@
 	while (token != NULL)
 	{
 		SMTP_SKIP_SPACE(token);
-		snprintf(Buffer, MAIL_BUFFER_SIZE, RCPT TO:%s\r\n, token);
+		FormatEmailAddress(Buffer, token, RCPT TO:%s\r\n);
 		if ((res = Post(Buffer)) != SUCCESS) {
 			efree(tempMailTo);
 			return (res);
@@ -457,7 +457,7 @@
 		while (token != NULL)
 		{
 			SMTP_SKIP_SPACE(token);
-			snprintf(Buffer, MAIL_BUFFER_SIZE, RCPT TO:%s\r\n, token);
+			FormatEmailAddress(Buffer, token, RCPT TO:%s\r\n);
 			if ((res = Post(Buffer)) != SUCCESS) {
 efree(tempMailTo);
 return (res);
@@ -487,7 +487,7 @@
 		while (token != NULL)
 		{
 			SMTP_SKIP_SPACE(token);
-			snprintf(Buffer, MAIL_BUFFER_SIZE, RCPT TO:%s\r\n, token);
+			FormatEmailAddress(Buffer, token, RCPT TO:%s\r\n);
 			if ((res = Post(Buffer)) != SUCCESS) {
 efree(tempMailTo);
 return (res);
@@ -512,7 +512,7 @@
 		while (token != NULL)
 		{
 			SMTP_SKIP_SPACE(token);
-			snprintf(Buffer, MAIL_BUFFER_SIZE, RCPT TO:%s\r\n, token);
+			FormatEmailAddress(Buffer, token, RCPT TO:%s\r\n);
 			if ((res = Post(Buffer)) != SUCCESS) {
 efree(tempMailTo);
 return (res);
@@ -545,7 +545,7 @@
 			while (token != NULL)
 			{
 SMTP_SKIP_SPACE(token);
-snprintf(Buffer, MAIL_BUFFER_SIZE, RCPT TO:%s\r\n, token);
+FormatEmailAddress(Buffer, token, RCPT TO:%s\r\n);
 if ((res = Post(Buffer)) != SUCCESS) {
 	efree(tempMailTo);
 	return (res);
@@ -922,3 +922,30 @@
 	}
 	return (lAddr);
 } /* end GetAddr() */
+
+
+/*
+// Name:  int FormatEmailAddress
+// Input:
+// Output:
+// Description: Formats the email address to remove any content ouside
+//   of the angle brackets   as per RFC 2821.
+//
+//   Returns the invalidly formatted mail address if the   are
+//   unbalanced (the SMTP server should reject it if it's out of spec.)
+//
+// Author/Date:  garretts 08/18/2009
+// History:
+///
+int FormatEmailAddress(char* Buffer, char* EmailAddress, char* FormatString )  {
+	char *tmpAddress1, *tmpAddress2;
+	int result;
+
+	if( (tmpAddress1 = strchr(EmailAddress, ''))  (tmpAddress2 = strchr(tmpAddress1, ''))  ) {
+		*tmpAddress2 = 0; // terminate the string temporarily.
+		result = snprintf(Buffer, MAIL_BUFFER_SIZE, FormatString , tmpAddress1+1);
+		*tmpAddress2 = ''; // put it back the way it was.
+		return result;
+	}
+	return snprintf(Buffer, MAIL_BUFFER_SIZE , FormatString , EmailAddress );
+} /* end FormatEmailAddress() */

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2009-08-18 18:28:59 UTC (rev 287461)
+++ php/php-src/branches/PHP_5_3/NEWS	2009-08-18 18:58:33 UTC (rev 287462)
@@ -146,6 +146,7 @@
   com, Kalle)
 - Fixed bug #38091 (Mail() does not use FQDN when sending SMTP helo).
   (Kalle, Rick Yorgason)
+- Fixed bug #28038  (Sent incorrect RCPT TO commands to SMTP server) (Garrett)

 30 Jun 2009, PHP 5.3.0
 - Upgraded bundled PCRE to version 7.9. (Nuno)

Modified: php/php-src/branches/PHP_5_3/win32/sendmail.c
===
--- php/php-src/branches/PHP_5_3/win32/sendmail.c	2009-08-18 18:28:59 UTC (rev 287461)
+++ 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/tests/unexpected_ref_bug.phpt branches/PHP_5_2/Zend/zend_execute_API.c branches/PHP_5_2/Zend/zend_vm_def.h branches/PHP_5_2/Zend/zend_vm_execute.h br

2009-08-18 Thread Stanislav Malyshev
stas Tue, 18 Aug 2009 20:51:49 +

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

Log:
fix crash when unexpectedly passed by-ref parameter is modified

Changed paths:
A   php/php-src/branches/PHP_5_2/Zend/tests/unexpected_ref_bug.phpt
U   php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c
U   php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h
U   php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h
A   
php/php-src/branches/PHP_5_2/ext/standard/tests/array/unexpected_array_mod_bug.phpt
A   php/php-src/branches/PHP_5_3/Zend/tests/unexpected_ref_bug.phpt
U   php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c
U   php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h
U   php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h
A   
php/php-src/branches/PHP_5_3/ext/standard/tests/array/unexpected_array_mod_bug.phpt
A   php/php-src/trunk/Zend/tests/unexpected_ref_bug.phpt
U   php/php-src/trunk/Zend/zend_execute_API.c
U   php/php-src/trunk/Zend/zend_vm_def.h
U   php/php-src/trunk/Zend/zend_vm_execute.h

Added: php/php-src/branches/PHP_5_2/Zend/tests/unexpected_ref_bug.phpt
===
--- php/php-src/branches/PHP_5_2/Zend/tests/unexpected_ref_bug.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_2/Zend/tests/unexpected_ref_bug.phpt	2009-08-18 20:51:49 UTC (rev 287466)
@@ -0,0 +1,18 @@
+--TEST--
+Crash when function parameter modified via unexpected reference
+--FILE--
+?php
+function my_errorhandler($errno,$errormsg) {
+  global $my_var;
+  $my_var = 0;
+  return true;
+}
+set_error_handler(my_errorhandler);
+$my_var = str_repeat(A,64);
+$data = call_user_func_array(explode,array(new StdClass(), $my_var));
+$my_var=array(1,2,3);
+$data = call_user_func_array(implode,array($my_var, new StdClass()));
+echo Done.\n;
+?
+--EXPECTF--
+Done.


Property changes on: php/php-src/branches/PHP_5_2/Zend/tests/unexpected_ref_bug.phpt
___
Added: svn:executable
   + *

Modified: php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c
===
--- php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c	2009-08-18 20:49:39 UTC (rev 287465)
+++ php/php-src/branches/PHP_5_2/Zend/zend_execute_API.c	2009-08-18 20:51:49 UTC (rev 287466)
@@ -921,6 +921,12 @@
 	for (i=0; ifci-param_count; i++) {
 		zval *param;

+		if(EX(function_state).function-type == ZEND_INTERNAL_FUNCTION
+			 !ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i + 1)
+			 PZVAL_IS_REF(*fci-params[i])) {
+			SEPARATE_ZVAL(fci-params[i]);
+		}
+
 		if (ARG_SHOULD_BE_SENT_BY_REF(EX(function_state).function, i+1)
 			 !PZVAL_IS_REF(*fci-params[i])) {
 			if ((*fci-params[i])-refcount1) {

Modified: php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h
===
--- php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h	2009-08-18 20:49:39 UTC (rev 287465)
+++ php/php-src/branches/PHP_5_2/Zend/zend_vm_def.h	2009-08-18 20:51:49 UTC (rev 287466)
@@ -2371,6 +2371,10 @@
 		zend_error_noreturn(E_ERROR, Only variables can be passed by reference);
 	}

+  	if (EX(function_state).function-type == ZEND_INTERNAL_FUNCTION  !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline-op2.u.opline_num)) {
+   ZEND_VM_DISPATCH_TO_HELPER(zend_send_by_var_helper);
+}
+
 	SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
 	varptr = *varptr_ptr;
 	varptr-refcount++;

Modified: php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h
===
--- php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h	2009-08-18 20:49:39 UTC (rev 287465)
+++ php/php-src/branches/PHP_5_2/Zend/zend_vm_execute.h	2009-08-18 20:51:49 UTC (rev 287466)
@@ -7584,6 +7584,10 @@
 		zend_error_noreturn(E_ERROR, Only variables can be passed by reference);
 	}

+  	if (EX(function_state).function-type == ZEND_INTERNAL_FUNCTION  !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline-op2.u.opline_num)) {
+   return zend_send_by_var_helper_SPEC_VAR(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
 	SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
 	varptr = *varptr_ptr;
 	varptr-refcount++;
@@ -20009,6 +20013,10 @@
 		zend_error_noreturn(E_ERROR, Only variables can be passed by reference);
 	}

+  	if (EX(function_state).function-type == ZEND_INTERNAL_FUNCTION  !ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline-op2.u.opline_num)) {
+   return zend_send_by_var_helper_SPEC_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+}
+
 	SEPARATE_ZVAL_TO_MAKE_IS_REF(varptr_ptr);
 	varptr = *varptr_ptr;
 	varptr-refcount++;

Added: php/php-src/branches/PHP_5_2/ext/standard/tests/array/unexpected_array_mod_bug.phpt
===
---