From 9e932279f8dbecc00f12da496fdf97c280b2d64c Mon Sep 17 00:00:00 2001 From: fQwQf Date: Wed, 25 Nov 2026 21:13:05 +0800 Subject: [PATCH] Keep the shell iterator at its terminator Stop advancing current_shell once testsudoers_getusershell() reaches the terminating NULL pointer. --- plugins/sudoers/tsgetusershell.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/sudoers/tsgetusershell.c b/plugins/sudoers/tsgetusershell.c index 88eaa5b79a..a2e583de34 100644 --- a/plugins/sudoers/tsgetusershell.c +++ b/plugins/sudoers/tsgetusershell.c @@ -127,6 +127,8 @@ testsudoers_getusershell(void) if (current_shell == NULL) current_shell = read_shells(); + if (*current_shell == NULL) + debug_return_str(NULL); debug_return_str(*current_shell++); }