]> granicus.if.org Git - php/commitdiff
Fixed crash when passing invalid timestamp (negative integer on win32)
authorDmitry Stogov <dmitry@php.net>
Wed, 4 May 2011 07:53:22 +0000 (07:53 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 4 May 2011 07:53:22 +0000 (07:53 +0000)
ext/soap/php_encoding.c

index 8a5e6e75ab2b634b73d6c9eefa90998a16078cd2..40899c124a318bbe6926a738f2afbb515b09081e 100644 (file)
@@ -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) {