]> granicus.if.org Git - sudo/commitdiff
Avoid a false positive. Coverity CID 104056.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 May 2016 21:54:06 +0000 (15:54 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 5 May 2016 21:54:06 +0000 (15:54 -0600)
plugins/sudoers/env.c

index b0097f2412d8b90a3894a44439ca7bc52d625048..238d9124840a82ce4e4a39468857e83fcb35db48 100644 (file)
@@ -964,8 +964,7 @@ rebuild_env(void)
         * from user's environment.
         */
        if (ISSET(sudo_mode, MODE_LOGIN_SHELL) || !ISSET(didvar, KEPT_MAIL)) {
-           cp = _PATH_MAILDIR;
-           if (cp[sizeof(_PATH_MAILDIR) - 2] == '/') {
+           if (_PATH_MAILDIR[sizeof(_PATH_MAILDIR) - 2] == '/') {
                if (asprintf(&cp, "MAIL=%s%s", _PATH_MAILDIR, runas_pw->pw_name) == -1)
                    goto bad;
            } else {