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 | 0bce4957e59bafa18eb7d9408a2ff360d427a967 (patch) | |
tree | ad6fee786538cdc9f4e23ca5a3e01301f3262ca7 /ext/soap/php_encoding.c | |
parent | 278392a10bcbb0f694fc02dbf1a30e4b99c83a52 (diff) | |
download | php-git-0bce4957e59bafa18eb7d9408a2ff360d427a967.tar.gz |
Fixed crash when passing invalid timestamp (negative integer on win32)
Diffstat (limited to 'ext/soap/php_encoding.c')
-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 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) { |