diff options
author | Dmitry Stogov <dmitry@php.net> | 2011-05-04 07:53:22 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2011-05-04 07:53:22 +0000 |
commit | fbe8cf9a408de367bc019d097b9175a4c7d09d72 (patch) | |
tree | 61d4533a6f7c6179647cf97e51ff7dbfc2b23933 | |
parent | 354cb67597b6956158837c36936b68f56c0daf09 (diff) | |
download | php-git-fbe8cf9a408de367bc019d097b9175a4c7d09d72.tar.gz |
Fixed crash when passing invalid timestamp (negative integer on win32)
-rw-r--r-- | ext/soap/php_encoding.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/soap/php_encoding.c b/ext/soap/php_encoding.c index 198f535fee..e87c84b263 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2962,6 +2962,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) { |