]> granicus.if.org Git - sudo/commitdiff
Fix off by one error in number of bytes allocated via malloc (does not
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 31 Dec 2001 05:53:23 +0000 (05:53 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 31 Dec 2001 05:53:23 +0000 (05:53 +0000)
affected any released version of sudo).

env.c

diff --git a/env.c b/env.c
index d15e765057e4921489e979ca28e5e6d8d94a7c8e..0f82158cc4c8b1bd472b853b6f7b38a2ec012055 100644 (file)
--- a/env.c
+++ b/env.c
@@ -431,7 +431,7 @@ rebuild_env(sudo_mode, envp)
 
     /* Add the SUDO_COMMAND envariable (cmnd + args). */
     if (user_args) {
-       cp = emalloc(strlen(user_cmnd) + strlen(user_args) + 14);
+       cp = emalloc(strlen(user_cmnd) + strlen(user_args) + 15);
        sprintf(cp, "SUDO_COMMAND=%s %s", user_cmnd, user_args);
        insert_env(newenvp, cp);
     } else