From bd55e5ccce4b35ffb1028d7810b93df3b7522d05 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Wed, 6 Nov 2013 16:17:26 +0100 Subject: auth: fix use of uninitialized variable err 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. * 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 167d8f02..91a21e45 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; -- cgit v1.2.3