From: Dmitry Stogov Date: Wed, 4 May 2011 07:53:22 +0000 (+0000) Subject: Fixed crash when passing invalid timestamp (negative integer on win32) X-Git-Tag: php-5.3.7RC1~149 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0bce4957e59bafa18eb7d9408a2ff360d427a967;p=php Fixed crash when passing invalid timestamp (negative integer on win32) --- diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index b77f2a28a7..7ee031056f 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2984,6 +2984,9 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma 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) {