comctl32: Cope with invalid date formats in MONTHCAL_CalculateDayOfWeek (valgrind)

Bruno Jesus 00cpxxx at gmail.com
Mon Jun 23 20:43:53 CDT 2014


Fixes bug https://bugs.winehq.org/show_bug.cgi?id=28741
-------------- next part --------------
diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index 84a01da..64c8fe9 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -480,8 +480,10 @@ int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace)
 
   MONTHCAL_CopyDate(date, &st);
 
-  SystemTimeToFileTime(&st, &ft);
-  FileTimeToSystemTime(&ft, &st);
+  if(SystemTimeToFileTime(&st, &ft))
+      FileTimeToSystemTime(&ft, &st);
+  else
+      WARN("Conversion failed for %d-%d-%d\n", st.wYear, st.wMonth, st.wDay);
 
   if (inplace) date->wDayOfWeek = st.wDayOfWeek;
 


More information about the wine-patches mailing list