]> granicus.if.org Git - sudo/commitdiff
Quiet a false positive found by several static analysis tools.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 23 Sep 2011 23:37:21 +0000 (19:37 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 23 Sep 2011 23:37:21 +0000 (19:37 -0400)
These tools don't know that log_error() does not return (it longjmps
to error_jmp which returns to the sudo front-end).

plugins/sudoers/sudoers.c

index a3816e2cb8785ec0a9527d6c87870f7e321ec505..4adabaac64e1ae9b80b280d143b1ab4f0aaac330 100644 (file)
@@ -797,7 +797,7 @@ init_vars(char * const envp[])
      * can read the shadow passwd file if necessary.
      */
     if ((sudo_user.pw = sudo_getpwnam(user_name)) == NULL) {
-       struct passwd pw;
+       static struct passwd pw;
 
        /* Create a fake struct passwd for log_error(). */
        memset(&pw, 0, sizeof(pw));