cvs: php4 /ext/standard datetime.c

From: Date: Sun, 20 Jan 2002 20:16:55 +0000
Subject: cvs: php4 /ext/standard datetime.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9115@lists.php.net to get a copy of this message
mfischer Sun Jan 20 15:16:55 2002 EDT Modified files: /php4/ext/standard datetime.c Log: - Fix crash with invalid localtime on Win32 systems. Index: php4/ext/standard/datetime.c diff -u php4/ext/standard/datetime.c:1.81 php4/ext/standard/datetime.c:1.82 --- php4/ext/standard/datetime.c:1.81 Tue Dec 11 10:30:28 2001 +++ php4/ext/standard/datetime.c Sun Jan 20 15:16:54 2002 @@ -19,7 +19,7 @@ */ -/* $Id: datetime.c,v 1.81 2001/12/11 15:30:28 sebastian Exp $ */ +/* $Id: datetime.c,v 1.82 2002/01/20 20:16:54 mfischer Exp $ */ #include "php.h" @@ -586,7 +586,11 @@ assoc_array = Z_LVAL_PP(assoc_array_arg); break; } - ta = php_localtime_r(&timestamp, &tmbuf); + if (NULL == (ta = php_localtime_r(&timestamp, &tmbuf))) { + php_error(E_WARNING, "%s(): invalid local time", + get_active_function_name(TSRMLS_C)); + RETURN_FALSE; + } if (array_init(return_value) == FAILURE) { php_error(E_ERROR, "Cannot prepare return array from localtime"); RETURN_FALSE;

« previous php.cvs (#9115) next »