bug68027.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Bug #68027 (buffer overflow in mkgmtime() function)
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("xmlrpc")) print "skip";
  6. ?>
  7. --FILE--
  8. <?php
  9. $d = '6-01-01 20:00:00';
  10. xmlrpc_set_type($d, 'datetime');
  11. var_dump($d);
  12. $datetime = "2001-0-08T21:46:40-0400";
  13. $obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>");
  14. print_r($obj);
  15. $datetime = "34770-0-08T21:46:40-0400";
  16. $obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>");
  17. print_r($obj);
  18. echo "Done\n";
  19. ?>
  20. --EXPECTF--
  21. object(stdClass)#1 (3) {
  22. ["scalar"]=>
  23. string(16) "6-01-01 20:00:00"
  24. ["xmlrpc_type"]=>
  25. string(8) "datetime"
  26. ["timestamp"]=>
  27. int(%d)
  28. }
  29. stdClass Object
  30. (
  31. [scalar] => 2001-0-08T21:46:40-0400
  32. [xmlrpc_type] => datetime
  33. [timestamp] => %s
  34. )
  35. stdClass Object
  36. (
  37. [scalar] => 34770-0-08T21:46:40-0400
  38. [xmlrpc_type] => datetime
  39. [timestamp] => %d
  40. )
  41. Done