4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: Win32: Crash on Windows when using a bad argument for strftime().
13 Solution: Use the bad_param_handler(). (Mike Williams)
17 *** ../vim-7.3.008/src/os_win32.c 2010-08-15 21:57:27.000000000 +0200
18 --- src/os_win32.c 2010-09-21 17:02:54.000000000 +0200
25 + #if ((defined(__MINGW32__) || defined (__CYGWIN32__)) && \
26 + __MSVCRT_VERSION__ >= 0x800) || (defined(_MSC_VER) && _MSC_VER >= 1400)
28 + * Bad parameter handler.
30 + * Certain MS CRT functions will intentionally crash when passed invalid
31 + * parameters to highlight possible security holes. Setting this function as
32 + * the bad parameter handler will prevent the crash.
34 + * In debug builds the parameters contain CRT information that might help track
35 + * down the source of a problem, but in non-debug builds the arguments are all
36 + * NULL/0. Debug builds will also produce assert dialogs from the CRT, it is
37 + * worth allowing these to make debugging of issues easier.
40 + bad_param_handler(const wchar_t *expression,
41 + const wchar_t *function,
42 + const wchar_t *file,
44 + uintptr_t pReserved)
48 + # define SET_INVALID_PARAM_HANDLER \
49 + ((void)_set_invalid_parameter_handler(bad_param_handler))
51 + # define SET_INVALID_PARAM_HANDLER
63 + /* Silently handle invalid parameters to CRT functions */
64 + SET_INVALID_PARAM_HANDLER;
66 /* Let critical errors result in a failure, not in a dialog box. Required
67 * for the timestamp test to work on removed floppies. */
68 SetErrorMode(SEM_FAILCRITICALERRORS);
75 + /* Silently handle invalid parameters to CRT functions */
76 + SET_INVALID_PARAM_HANDLER;
78 /* Let critical errors result in a failure, not in a dialog box. Required
79 * for the timestamp test to work on removed floppies. */
80 SetErrorMode(SEM_FAILCRITICALERRORS);
81 *** ../vim-7.3.008/src/version.c 2010-09-21 16:56:29.000000000 +0200
82 --- src/version.c 2010-09-21 17:27:36.000000000 +0200
86 { /* Add new patch number below this line */
92 Wizards had always known that the act of observation changed the thing that
93 was observed, and sometimes forgot that it also changed the observer too.
94 Terry Pratchett - Interesting times
96 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
97 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
98 \\\ download, build and distribute -- http://www.A-A-P.org ///
99 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///