krb5 commit [krb5-1.15]: Always set appdefault_get() output argument

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/8420b1404f01bdfe85450d569d89c80ac499dabb
commit 8420b1404f01bdfe85450d569d89c80ac499dabb
Author: Nehal J Wani <[email protected]>
Date:   Sun Jan 28 03:02:57 2018 -0500

    Always set appdefault_get() output argument
    
    gcc 7 cannot determine that appdefault_get() always sets *ret_value
    when it returns zero, so issues a "may be used uninitialized" warning
    in its caller.  Set *ret_value at the beginning of the function body
    in accordance with current practices.
    
    [[email protected]: clarified commit message]
    
    (cherry picked from commit 364c608911af2f227695bb527d4e42f091ee8bd3)
    
    ticket: 8639
    version_fixed: 1.15.3

 src/lib/krb5/krb/appdefault.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/lib/krb5/krb/appdefault.c b/src/lib/krb5/krb/appdefault.c
index 73fd260..3f7dc23 100644
--- a/src/lib/krb5/krb/appdefault.c
+++ b/src/lib/krb5/krb/appdefault.c
@@ -44,6 +44,8 @@ appdefault_get(krb5_context context, const char *appname, const krb5_data *realm
     krb5_error_code retval;
     const char * realmstr =  realm?realm->data:NULL;
 
+    *ret_value = NULL;
+
     if (!context || (context->magic != KV5M_CONTEXT))
         return KV5M_CONTEXT;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.