Piotr Caban : msvcrt: Don't crash on NULL struct _tm in asctime.

Alexandre Julliard julliard at winehq.org
Mon May 12 15:35:48 CDT 2014


Module: wine
Branch: master
Commit: c18d52d346898be56239976c1b73007a06d2f38d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c18d52d346898be56239976c1b73007a06d2f38d

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon May 12 14:34:51 2014 +0200

msvcrt: Don't crash on NULL struct _tm in asctime.

---

 dlls/msvcrt/time.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c
index a6d4691..9c15bf4 100644
--- a/dlls/msvcrt/time.c
+++ b/dlls/msvcrt/time.c
@@ -1263,7 +1263,7 @@ static char* asctime_buf(char *buf, const struct MSVCRT_tm *mstm)
     static const char month[12][4] = {"Jan", "Feb", "Mar", "Apr", "May",
         "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
 
-    if (mstm->tm_sec<0 || mstm->tm_sec>59
+    if (!mstm || mstm->tm_sec<0 || mstm->tm_sec>59
             || mstm->tm_min<0 || mstm->tm_min>59
             || mstm->tm_hour<0 || mstm->tm_hour>23
             || mstm->tm_mon<0 || mstm->tm_mon>11




More information about the wine-cvs mailing list