Browse Source

Fixed crash when passing invalid timestamp (negative integer on win32)

experimental/with_scalar_types
Dmitry Stogov 15 years ago
parent
commit
fbe8cf9a40
  1. 3
      ext/soap/php_encoding.c

3
ext/soap/php_encoding.c

@ -2962,6 +2962,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) {

Loading…
Cancel
Save