diff options
author | Christopher Faylor <me@cgf.cx> | 2013-12-22 07:07:48 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2013-12-22 07:07:48 +0000 |
commit | 53b14dc2b1c1884dbd397c7a8d3b13cd2b6c9203 (patch) | |
tree | c7a7aa8052d5bb605f1ac40ff51d53531d32f87a | |
parent | 57cfbb7bbf1019520fb37deee8aa0c2cf82097b0 (diff) | |
download | newlib-53b14dc2b1c1884dbd397c7a8d3b13cd2b6c9203.zip newlib-53b14dc2b1c1884dbd397c7a8d3b13cd2b6c9203.tar.gz newlib-53b14dc2b1c1884dbd397c7a8d3b13cd2b6c9203.tar.bz2 |
* strace.cc (strace::vsprntf): Fix potential (if unlikely) use of uninitialized
variable.
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/strace.cc | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2c943ac..1e97568 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2013-12-22 Christopher Faylor <me.cygwin2013@cgf.cx> + + * strace.cc (strace::vsprntf): Fix potential (if unlikely) use of + uninitialized variable. + 2013-12-18 Christopher Faylor <me.cygwin2013@cgf.cx> * dcrt0.cc (dll_crt0_1): Remove NtSetTimerResolution. diff --git a/winsup/cygwin/strace.cc b/winsup/cygwin/strace.cc index 3c73a71..3d54c10 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) |