From: Todd C. Miller Date: Thu, 5 May 2016 21:54:06 +0000 (-0600) Subject: Avoid a false positive. Coverity CID 104056. X-Git-Tag: SUDO_1_8_17^2~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7fa036d4273f9a1c653cc4675a8b113bf233c58;p=sudo Avoid a false positive. Coverity CID 104056. --- diff --git a/plugins/sudoers/env.c b/plugins/sudoers/env.c index b0097f241..238d91248 100644 --- a/plugins/sudoers/env.c +++ b/plugins/sudoers/env.c @@ -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 {