diff options
author | Antony Dovgal <tony2001@php.net> | 2007-06-07 08:44:41 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2007-06-07 08:44:41 +0000 |
commit | c9805e7b9240c9513c4fb6add41b004328caf463 (patch) | |
tree | 44479ebe75a58ebcd0370f86de3a66d79130be1a /ext/calendar/cal_unix.c | |
parent | 91da96ba71867b72278aeb4d6deaff334c7f3771 (diff) | |
download | php-git-c9805e7b9240c9513c4fb6add41b004328caf463.tar.gz |
MFH: check return value of *time_r() functions for NULL
Diffstat (limited to 'ext/calendar/cal_unix.c')
-rw-r--r-- | ext/calendar/cal_unix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/calendar/cal_unix.c b/ext/calendar/cal_unix.c index 97c138df2d..4efe16eeeb 100644 --- a/ext/calendar/cal_unix.c +++ b/ext/calendar/cal_unix.c @@ -50,6 +50,10 @@ PHP_FUNCTION(unixtojd) } ta = php_localtime_r(&t, &tmbuf); + if (!ta) { + RETURN_FALSE; + } + jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1, ta->tm_mday); RETURN_LONG(jdate); |