bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 11/14] auth: fix use of uninitialized variable err


From: Justus Winter
Subject: [PATCH 11/14] auth: fix use of uninitialized variable err
Date: Fri, 8 Nov 2013 21:24:19 +0100

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 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]