Skip to content

Commit fbe8cf9

Browse files
committed
Fixed crash when passing invalid timestamp (negative integer on win32)
1 parent 354cb67 commit fbe8cf9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/soap/php_encoding.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,6 +2962,9 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
29622962
timestamp = Z_LVAL_P(data);
29632963
ta = php_localtime_r(&timestamp, &tmbuf);
29642964
/*ta = php_gmtime_r(&timestamp, &tmbuf);*/
2965+
if (!ta) {
2966+
soap_error1(E_ERROR, "Encoding: Invalid timestamp %ld", Z_LVAL_P(data));
2967+
}
29652968

29662969
buf = (char *) emalloc(buf_len);
29672970
while ((real_len = strftime(buf, buf_len, format, ta)) == buf_len || real_len == 0) {

0 commit comments

Comments
 (0)