From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 1E8C1385DC00; Fri, 17 Apr 2020 08:08:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E8C1385DC00 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] cygheap_pwdgrp: Handle invalid db_* entries correctly X-Act-Checkin: newlib-cygwin X-Git-Author: David Macek via Cygwin-patches X-Git-Refname: refs/heads/master X-Git-Oldrev: 1fac24078a8c619d015a5e8d951c7d127f7c75f7 X-Git-Newrev: 5951b3e600f32fd1d96b73f4ccf05d081a5d9428 Message-Id: <20200417080802.1E8C1385DC00@sourceware.org> Date: Fri, 17 Apr 2020 08:08:02 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2020 08:08:02 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5951b3e600f32fd1d96b73f4ccf05d081a5d9428 commit 5951b3e600f32fd1d96b73f4ccf05d081a5d9428 Author: David Macek via Cygwin-patches Date: Thu Apr 16 23:09:07 2020 +0200 cygheap_pwdgrp: Handle invalid db_* entries correctly If the first scheme in db_* was invalid, the code would think there were no schemes specified and replace the second scheme with NSS_SCHEME_DESC. Signed-off-by: David Macek Diff: --- winsup/cygwin/uinfo.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index 2d5de359b..57d90189d 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -823,7 +823,10 @@ cygheap_pwdgrp::nss_init_line (const char *line) c, e - c); } else - debug_printf ("Invalid nsswitch.conf content: %s", line); + { + debug_printf ("Invalid nsswitch.conf content: %s", line); + --idx; + } c += strcspn (c, " \t"); c += strspn (c, " \t"); ++idx;