[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 11/14] auth: fix use of uninitialized variable err
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 11/14] auth: fix use of uninitialized variable err |
Date: |
Sat, 9 Nov 2013 19:15:11 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Fri 08 Nov 2013 21:24:19 +0100, a écrit :
> Previously a plausible execution path existed so the value of err was
> undefined at the end of the function, making the function return
> arbitrary error values. Fix this by initializing it to 0.
>
> Found using the Clang Static Analyzer.
Ack
> * auth/auth.c (S_auth_server_authenticate): Initialize err to 0.
> ---
> auth/auth.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/auth/auth.c b/auth/auth.c
> index 167d8f0..91a21e4 100644
> --- a/auth/auth.c
> +++ b/auth/auth.c
> @@ -381,7 +381,7 @@ S_auth_server_authenticate (struct authhandle *serverauth,
> {
> struct pending_user *u;
> struct authhandle *user;
> - error_t err;
> + error_t err = 0;
>
> if (! serverauth)
> return EOPNOTSUPP;
> --
> 1.7.10.4
>
>
--
Samuel
Client: "This program has been successfully installed."
Vendeur (surpris): "Et où voyez-vous une erreur ?"
Client: "C'est << HAS BEEN >> !"
- [PATCH 01/14] term: fix error handling in hurdio_mdmctl, Justus Winter, 2013/11/08
- [PATCH 07/14] proc: fix the declaraton of genpid, Justus Winter, 2013/11/08
- [PATCH 11/14] auth: fix use of uninitialized variable err, Justus Winter, 2013/11/08
- Re: [PATCH 11/14] auth: fix use of uninitialized variable err,
Samuel Thibault <=
- [PATCH 10/14] init: fix memory leak, Justus Winter, 2013/11/08
- [PATCH 14/14] mach-defpager: remove unused variables, Justus Winter, 2013/11/08
- [PATCH 04/14] proc: turn count_up and store_pid into normal functions, Justus Winter, 2013/11/08
- [PATCH 09/14] proc: fix error handling in S_proc_exception_raise, Justus Winter, 2013/11/08
- [PATCH 06/14] proc: turn {init, add}str, compare_versions into normal functions, Justus Winter, 2013/11/08