]> granicus.if.org Git - sudo/commitdiff
In sudo_unsetenv_nodebug(), decrement envp.env_len after removing
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 Jan 2017 18:12:56 +0000 (11:12 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 16 Jan 2017 18:12:56 +0000 (11:12 -0700)
the variable.  From Paul Zirnik of SUSE.

plugins/sudoers/env.c

index 8ba353b440ff7eea1a465757f34cd3941cdc4e74..04b3749a3ee3a1540bf6c957497d4c89de6b46d4 100644 (file)
@@ -497,6 +497,7 @@ sudo_unsetenv_nodebug(const char *var)
            char **cur = ep;
            while ((*cur = *(cur + 1)) != NULL)
                cur++;
+           env.env_len--;
            /* Keep going, could be multiple instances of the var. */
        } else {
            ep++;