Re: svn: /php/php-src/ branches/PHP_5_2/ext/soap/php_encoding.c branches/PHP_5_3/ext/soap/php_encoding.c trunk/ext/soap/php_encoding.c
| From: | Antony Dovgal | Date: | Wed, 04 May 2011 07:58:10 +0000 |
| Subject: | Re: svn: /php/php-src/ branches/PHP_5_2/ext/soap/php_encoding.c branches/PHP_5_3/ext/soap/php_encoding.c trunk/ext/soap/php_encoding.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-64869@lists.php.net to get a copy of this message | ||
FATAL error on invalid data? That looks wrong.
Can't you make it a warning instead?
On 05/04/2011 11:53 AM, Dmitry Stogov wrote:
-- Wbr, Antony Dovgal --- http://pinba.org - realtime statistics for PHPdmitry Wed, 04 May 2011 07:53:22 +0000Revision: http://svn.php.net/viewvc?view=revision&revision=310753 Log: Fixed crash when passing invalid timestamp (negative integer on win32) Changed paths:U php/php-src/branches/PHP_5_2/ext/soap/php_encoding.c U php/php-src/branches/PHP_5_3/ext/soap/php_encoding.c U php/php-src/trunk/ext/soap/php_encoding.cModified: php/php-src/branches/PHP_5_2/ext/soap/php_encoding.c =================================================================== --- php/php-src/branches/PHP_5_2/ext/soap/php_encoding.c 2011-05-04 05:39:17 UTC (rev 310752) +++ php/php-src/branches/PHP_5_2/ext/soap/php_encoding.c 2011-05-04 07:53:22 UTC (rev 310753) @@ -2872,6 +2872,9 @@ timestamp = Z_LVAL_P(data); ta = php_localtime_r(×tamp,&tmbuf); /*ta = php_gmtime_r(×tamp,&tmbuf);*/ + if (!ta) { + soap_error1(E_ERROR, "Encoding: Invalid timestamp %ld", Z_LVAL_P(data)); + } buf = (char *) emalloc(buf_len); while ((real_len = strftime(buf, buf_len, format, ta)) == buf_len || real_len == 0) { Modified: php/php-src/branches/PHP_5_3/ext/soap/php_encoding.c =================================================================== --- php/php-src/branches/PHP_5_3/ext/soap/php_encoding.c 2011-05-04 05:39:17 UTC (rev 310752) +++ php/php-src/branches/PHP_5_3/ext/soap/php_encoding.c 2011-05-04 07:53:22 UTC (rev 310753) @@ -2984,6 +2984,9 @@ timestamp = Z_LVAL_P(data); ta = php_localtime_r(×tamp,&tmbuf); /*ta = php_gmtime_r(×tamp,&tmbuf);*/ + if (!ta) { + soap_error1(E_ERROR, "Encoding: Invalid timestamp %ld", Z_LVAL_P(data)); + } buf = (char *) emalloc(buf_len); while ((real_len = strftime(buf, buf_len, format, ta)) == buf_len || real_len == 0) { Modified: php/php-src/trunk/ext/soap/php_encoding.c =================================================================== --- php/php-src/trunk/ext/soap/php_encoding.c 2011-05-04 05:39:17 UTC (rev 310752) +++ php/php-src/trunk/ext/soap/php_encoding.c 2011-05-04 07:53:22 UTC (rev 310753) @@ -2962,6 +2962,9 @@ timestamp = Z_LVAL_P(data); ta = php_localtime_r(×tamp,&tmbuf); /*ta = php_gmtime_r(×tamp,&tmbuf);*/ + if (!ta) { + soap_error1(E_ERROR, "Encoding: Invalid timestamp %ld", Z_LVAL_P(data)); + } buf = (char *) emalloc(buf_len); while ((real_len = strftime(buf, buf_len, format, ta)) == buf_len || real_len == 0) {