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: Date: Wed, 04 May 2011 07:53:22 +0000
Subject: 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
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-64868@lists.php.net to get a copy of this message
dmitry Wed, 04 May 2011 07:53:22 +0000 Revision: 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.c Modified: 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(&timestamp, &tmbuf); /*ta = php_gmtime_r(&timestamp, &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(&timestamp, &tmbuf); /*ta = php_gmtime_r(&timestamp, &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(&timestamp, &tmbuf); /*ta = php_gmtime_r(&timestamp, &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) {

« previous php.cvs (#64868) next »