PHP 4.0 Bug #7526 Updated: unixtojd (-x) causes php.exe to crash

From: Date: Mon, 30 Oct 2000 16:14:16 +0000
Subject: PHP 4.0 Bug #7526 Updated: unixtojd (-x) causes php.exe to crash
Groups: php.dev 
Request: Send a blank email to php-dev+get-36434@lists.php.net to get a copy of this message
ID: 7526 Updated by: stas Reported By: zak@php.net Status: Closed Bug Type: Calendar related Assigned To: Comments: Should be fixed in CVS, please reopen if still crashes. Previous Comments: --------------------------------------------------------------------------- [2000-10-30 01:07:18] zak@php.net Hello All, Calls to unixtojd() with a negative integer value cause php.exe to exit. The problem cannot be reproduced on OpenBSD 2.7 running PHP 4.0.3 pl 1. (For additional information, see below patch...) My C skills are practically non-existant. However, it seems that a simple patch like: --- cal_unix.c Sun Oct 29 23:00:43 2000 +++ patch.c Sun Oct 29 23:01:47 2000 @@ -39,6 +39,9 @@ } if(myargc==1) { + if(timestamp < 0) { + RETURN_FALSE; /* before beginning of unix epoch */ + } + convert_to_long(timestamp); t = timestamp->value.lval; I am probably wrong - but I thought that I should at least give a crack at fixing it. :) I would test this patch myself, except I have no way to compile on the windows platform. -- More info -- Windows generates a Program Error box with the following message: "php.exe has generated errors and will be closed by Windows. You will need to restart the program. An error log is being generated." No error is reported in the system logs. The Apache (Apache 1.3.12) error log records the error: Premature end of script headers: c:/program files/php4/php.exe --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7526

« previous php.dev (#36434) next »