From: Vadim Zeitlin Date: Sun, 30 Sep 2007 20:37:29 +0000 (+0000) Subject: don't crash in GetAsDOS() if the time is not in time_t range (bug 1804421) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1faa4ad2bad026fe931743ab5b741b12e5903d56?ds=inline don't crash in GetAsDOS() if the time is not in time_t range (bug 1804421) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index 087db34e89..d1ce06ab39 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -1607,6 +1607,7 @@ unsigned long wxDateTime::GetAsDOS() const time_t ticks = GetTicks(); struct tm tmstruct; struct tm *tm = wxLocaltime_r(&ticks, &tmstruct); + wxCHECK_MSG( tm, ULONG_MAX, _T("time can't be represented in DOS format") ); long year = tm->tm_year; year -= 80;