]> granicus.if.org Git - sudo/commitdiff
In rewind_perms() there is nothing to do if perm_stack_depth == 0.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 7 Aug 2013 15:42:14 +0000 (09:42 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 7 Aug 2013 15:42:14 +0000 (09:42 -0600)
plugins/sudoers/set_perms.c

index a887a512455182a0cb0591910742c980e74c498d..a38cb3a364c528f23e60528c3d326bf62b00839d 100644 (file)
@@ -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;
 }