From 9ded807a20a48d4482d21bea8cb4cc24f20f04bc Mon Sep 17 00:00:00 2001 From: Hartmut Holzgraefe Date: Wed, 14 Jun 2000 22:11:10 +0000 Subject: [PATCH] return FALSE from strftime on negative timestamp values they do not make sense anyway and seem to crash win2k --- ext/standard/datetime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/standard/datetime.c b/ext/standard/datetime.c index 30f0aa7778..d3da443f9b 100644 --- a/ext/standard/datetime.c +++ b/ext/standard/datetime.c @@ -664,6 +664,9 @@ void _php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm) if ((*format_arg)->value.str.len==0) { RETURN_FALSE; } + if (timestamp < 0) { + RETURN_FALSE; + } format = (*format_arg)->value.str.val; if (gm) { ta = php_gmtime_r(×tamp, &tmbuf); -- 2.50.1