diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8aabc6478..3cfd1c631 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-05-19 Corinna Vinschen + + * pinfo.cc (pinfo_basic::pinfo_basic): Fix size of progname array in + call to GetModuleFileNameW (CID 59935). + 2014-05-19 Corinna Vinschen * smallprintf.cc (__small_vsprintf): Add missing break in 'C' case. diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index 078e22230..4518d6d51 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -1,7 +1,7 @@ /* pinfo.cc: process table support Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010, 2011, 2012, 2013 Red Hat, Inc. + 2008, 2009, 2010, 2011, 2012, 2013, 2014 Red Hat, Inc. This file is part of Cygwin. @@ -38,7 +38,7 @@ public: pinfo_basic::pinfo_basic () { pid = dwProcessId = GetCurrentProcessId (); - GetModuleFileNameW (NULL, progname, sizeof (progname)); + GetModuleFileNameW (NULL, progname, sizeof (progname) / sizeof (WCHAR)); /* Default uid/gid are needed very early to initialize shared user info. */ uid = ILLEGAL_UID; gid = ILLEGAL_GID;