From 53b14dc2b1c1884dbd397c7a8d3b13cd2b6c9203 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 22 Dec 2013 07:07:48 +0000 Subject: [PATCH] * strace.cc (strace::vsprntf): Fix potential (if unlikely) use of uninitialized variable. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/strace.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2c943ac6b..1e9756841 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2013-12-22 Christopher Faylor + + * strace.cc (strace::vsprntf): Fix potential (if unlikely) use of + uninitialized variable. + 2013-12-18 Christopher Faylor * dcrt0.cc (dll_crt0_1): Remove NtSetTimerResolution. diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index 3c73a71ce..3d54c10e9 100644 --- a/winsup/cygwin/strace.cc +++ b/winsup/cygwin/strace.cc @@ -156,11 +156,12 @@ strace::vsprntf (char *buf, const char *func, const char *infmt, va_list ap) else if (__progname) sys_mbstowcs(pn = progname, NT_MAX_PATH, __progname); + WCHAR empty[1] = {}; PWCHAR p; if (!pn) GetModuleFileNameW (NULL, pn = progname, sizeof (progname)); if (!pn) - /* hmm */; + p = empty; else if ((p = wcsrchr (pn, L'\\')) != NULL) p++; else if ((p = wcsrchr (pn, L'/')) != NULL)