- prevent buffer overflow
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 30 Dec 2007 22:14:04 +0000 (22:14 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 30 Dec 2007 22:14:04 +0000 (22:14 +0000)
- zero initialize value to prevent random values being returned from unimplemented GetCalendarInfoA|W
- fixes bug 2918
See issue #2918 for more details.

svn path=/trunk/; revision=31507

reactos/dll/cpl/intl/date.c

index fb93294..26bec84 100644 (file)
@@ -34,7 +34,7 @@
 
 /* GLOBALS ******************************************************************/
 
-#define YEAR_STR_MAX_SIZE        4
+#define YEAR_STR_MAX_SIZE        5
 #define MAX_SHRT_DATE_SEPARATORS 3
 #define STD_DATE_SEP             _T(".")
 #define YEAR_DIFF                (99)
@@ -425,7 +425,7 @@ SetMaxDate(HWND hwndDlg, LCID lcid)
 static INT
 GetMaxDate(LCID lcid)
 {
-    INT nMaxDateVal;
+    INT nMaxDateVal = 0;
 
     GetCalendarInfo(lcid,
                     CAL_GREGORIAN,