[PATCH] Fix a compiler warning

Andreas Schneider asn at samba.org
Thu Jul 5 16:05:24 UTC 2018


Hi,

attached patch fixes a compiler warning. I don't see how the value could be 
used uninitialized but lets make sure.


Please review and push if OK.


Thanks,


	Andreas



-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D
-------------- next part --------------
>From 075023d64d2a56eaef07a724f7a4504777f8e15e Mon Sep 17 00:00:00 2001
From: Andreas Schneider <asn at samba.org>
Date: Thu, 5 Jul 2018 18:02:48 +0200
Subject: [PATCH] winbind_krb5_localauth: Fix a compiler warning

This can't used uninitialized but some compiler complains about it.

Signed-off-by: Andreas Schneider <asn at samba.org>
---
 nsswitch/krb5_plugin/winbind_krb5_localauth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nsswitch/krb5_plugin/winbind_krb5_localauth.c b/nsswitch/krb5_plugin/winbind_krb5_localauth.c
index 7c77609710a..b412575e4fe 100644
--- a/nsswitch/krb5_plugin/winbind_krb5_localauth.c
+++ b/nsswitch/krb5_plugin/winbind_krb5_localauth.c
@@ -84,8 +84,8 @@ static krb5_error_code winbind_userok(krb5_context context,
 	krb5_error_code code = 0;
 	char *princ_str = NULL;
 	struct passwd *pwd = NULL;
-	uid_t princ_uid;
-	uid_t lname_uid;
+	uid_t princ_uid = (uid_t)-1;
+	uid_t lname_uid = (uid_t)-1;
 	wbcErr wbc_status;
 	int cmp;
 
-- 
2.18.0



More information about the samba-technical mailing list