From 5951b3e600f32fd1d96b73f4ccf05d081a5d9428 Mon Sep 17 00:00:00 2001 From: David Macek via Cygwin-patches Date: Thu, 16 Apr 2020 23:09:07 +0200 Subject: [PATCH] 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 --- 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;