|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2000-10-30 11:14 UTC] stas@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
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