php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2673 calendar functions cause php crash when passed a number that is too big
Submitted: 1999-11-05 19:19 UTC Modified: 2002-06-16 14:18 UTC
From: agent86 at earthling dot net Assigned:
Status: Not a bug Package: Misbehaving function
PHP Version: 3.0.11 OS: NT4 sp5
Private report: No CVE-ID: None
 [1999-11-05 19:19 UTC] agent86 at earthling dot net
The following script will crash php every time.  It is actually any of the calendar functions that cause the crash.  I tried most of the jd to something functions.
   $jdate=filectime("d:/somedir/somefile");
   $filedate=jdtogregorian($jdate);

This causes a crash.  The dialog box title is: OleMainThreadWndName:php.exe - Application Error

The dialog box contents: 
The instruction at "0x0042447d" referenced memory at "0x00000000". The memory could not be "read".  Click OK to terminate the application

I realize I am passing a timestamp instead of julian count.  Originally I did this unintentionally.  What my error exposed is that passing a julian day count that is very large to the jdtosomething functions will cause them to crash php instead of merely generating an error message.

This occurs whether the module is loaded in php.ini or dynamically with dl(). I also get the same crash when I run the script in a dos box (no web server).

Not a serious bug, but it does cause a crash (at least for the NT version) if you pass a large number (like a timestamp) to the calendar functions.

Thanks!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 14:18 UTC] sander@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately, PHP 3 is no longer supported. Please download
the latest version of PHP 4 from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Nov 20 19:01:21 2019 UTC