php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2962 date function crashes php when value passed is out of range.
Submitted: 1999-12-12 16:42 UTC Modified: 2000-06-13 23:30 UTC
From: curt at zirzow dot org Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Beta 3 OS: FreeBSD 3.2
Private report: No CVE-ID: None
 [1999-12-12 16:42 UTC] curt at zirzow dot org
If you remove the +1 or -1 in the following code everthing
works ok. Otherwise I get 'document contains no data'.

<?  
echo 'begin';
// httpd exits on signal 8 (floating point exception)
echo date('l-d-Y h:m:s', 2147483647 + 1);
// or
echo date('l-d-Y h:m:s', -2147483648 - 1);
echo 'end';
?>

gdb backtrace:
#0  0x809300a in convert_to_long_base (op=0x81e08a8, base=10)
    at zend_operators.c:174
#1  0x8092fb5 in convert_to_long (op=0x81e08a8) at zend_operators.c:159
#2  0x80b3169 in _php3_date (ht=2, return_value=0xbfbfd730, list=0x8181c08,
    plist=0x8181c34, this_ptr=0x0, gm=0) at datetime.c:205
#3  0x80b3945 in php3_date (ht=2, return_value=0xbfbfd730, list=0x8181c08,
    plist=0x8181c34, this_ptr=0x0) at datetime.c:433
#4  0x80eab2f in execute (op_array=0x819b728) at zend_execute.c:1471
#5  0x8088f3d in php_execute_script (primary_file=0xbfbfda4c) at main.c:1199
#6  0x809ee15 in apache_php_module_main (r=0x81db034, fd=33,
    display_source_mode=0) at sapi_apache.c:87
#7  0x8087790 in send_php ()
#8  0x80877d4 in send_parsed_php ()
#9  0x80f55ff in ap_invoke_handler ()
#10 0x8108085 in process_request_internal ()
#11 0x81080e4 in ap_process_request ()
#12 0x80ffb2d in child_main ()
#13 0x80ffcb8 in make_child ()
#14 0x80ffe13 in startup_children ()
#15 0x81003c4 in standalone_main ()
#16 0x8100c17 in main ()
#17 0x805b0b5 in _start ()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-06-13 23:30 UTC] andrei at cvs dot php dot net
This no longer crashes PHP in latest version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 01:01:33 2024 UTC