[newlib-cygwin] Cygwin: passwd/group: raise local name buffer size

Corinna Vinschen corinna@sourceware.org
Wed Feb 13 12:18:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=507982af79847f44c763ff70db15104d78174b2e

commit 507982af79847f44c763ff70db15104d78174b2e
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Feb 13 12:41:55 2019 +0100

    Cygwin: passwd/group: raise local name buffer size
    
    Make sure a domain+username fits into the local name buffer.
    The former buffer size didn't take adding a domain name to
    a really_really_long_user_name into account.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/uinfo.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 4a5fa34..b70e384 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -1919,7 +1919,7 @@ char *
 pwdgrp::fetch_account_from_windows (fetch_user_arg_t &arg, cyg_ldap *pldap)
 {
   /* Used in LookupAccount calls. */
-  WCHAR namebuf[UNLEN + 1], *name = namebuf;
+  WCHAR namebuf[DNLEN + 1 + UNLEN + 1], *name = namebuf;
   WCHAR dom[DNLEN + 1] = L"";
   cygsid csid;
   DWORD nlen = UNLEN + 1;



More information about the Cygwin-cvs mailing list