summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2011-05-04 07:53:22 +0000
committerDmitry Stogov <dmitry@php.net>2011-05-04 07:53:22 +0000
commit13879d1d133fbac0c962026e615285a2e3470875 (patch)
treed19fb69289cc5911b8c01c5ce9247c025678e3ad
parent98fc9750f9d66c3a53e315d3e478ced2d893055d (diff)
downloadphp-git-13879d1d133fbac0c962026e615285a2e3470875.tar.gz
Fixed crash when passing invalid timestamp (negative integer on win32)
-rw-r--r--ext/soap/php_encoding.c3
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(&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) {