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 | 13879d1d133fbac0c962026e615285a2e3470875 (patch) | |
tree | d19fb69289cc5911b8c01c5ce9247c025678e3ad | |
parent | 98fc9750f9d66c3a53e315d3e478ced2d893055d (diff) | |
download | php-git-13879d1d133fbac0c962026e615285a2e3470875.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 8a5e6e75ab..40899c124a 100644 --- a/ext/soap/php_encoding.c +++ b/ext/soap/php_encoding.c @@ -2872,6 +2872,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) { |