From 23a2bdbcbad6c1e77a0cc727c747d67a569c6f06 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 7 Aug 2013 09:42:14 -0600 Subject: [PATCH] In rewind_perms() there is nothing to do if perm_stack_depth == 0. --- plugins/sudoers/set_perms.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/sudoers/set_perms.c b/plugins/sudoers/set_perms.c index a887a5124..a38cb3a36 100644 --- a/plugins/sudoers/set_perms.c +++ b/plugins/sudoers/set_perms.c @@ -88,9 +88,11 @@ rewind_perms(void) { debug_decl(rewind_perms, SUDO_DEBUG_PERMS) - while (perm_stack_depth > 1) - restore_perms(); - sudo_grlist_delref(perm_stack[0].grlist); + if (perm_stack_depth != 0) { + while (perm_stack_depth > 1) + restore_perms(); + sudo_grlist_delref(perm_stack[0].grlist); + } debug_return; } -- 2.40.0