diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-09 07:43:08 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-09 07:43:08 +0000 |
commit | 572e4807e6400e1f319d01ef88b1123d4c99efce (patch) | |
tree | d84b56124be9ede58f12d7dd02afa5e8eafbeea2 /win32 | |
parent | 9cd8b76e6df560d1da61138e99eab76b7c3e1f6b (diff) | |
download | ruby-572e4807e6400e1f319d01ef88b1123d4c99efce.tar.gz |
* win32/win32.c (unixtime_to_filetime): should check the return value
of localtime(). reported by snowjail at gmail.com.
[ruby-dev:44838] [Bug #5596]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c index fc1cd29b2d..b570a4295d 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -5758,6 +5758,9 @@ unixtime_to_filetime(time_t time, FILETIME *ft) FILETIME lt; tm = localtime(&time); + if (!tm) { + return -1; + } st.wYear = tm->tm_year + 1900; st.wMonth = tm->tm_mon + 1; st.wDayOfWeek = tm->tm_wday; |