[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Aug 11 16:09:02 UTC 2017


The branch, master has been updated
       via  abd74c3 heimdal: Fix printing a short int into a string
      from  b2f2ce0 examples: add cache effectiveness stats to gencache.stp

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit abd74c3ba5e3ee3f5320bff6ed7dff4fbcb79373
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Aug 9 17:01:09 2017 +0200

    heimdal: Fix printing a short int into a string
    
    The size of portstr is too small to print an integer and we should print
    a short anyway.
    
    This fixes building with GCC 7.1
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12930
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri Aug 11 18:08:04 CEST 2017 on sn-devel-144

-----------------------------------------------------------------------

Summary of changes:
 source4/heimdal/lib/krb5/krbhst.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/heimdal/lib/krb5/krbhst.c b/source4/heimdal/lib/krb5/krbhst.c
index 9822bfb..dae3207 100644
--- a/source4/heimdal/lib/krb5/krbhst.c
+++ b/source4/heimdal/lib/krb5/krbhst.c
@@ -326,13 +326,13 @@ krb5_krbhst_format_string(krb5_context context, const krb5_krbhst_info *host,
 			  char *hostname, size_t hostlen)
 {
     const char *proto = "";
-    char portstr[7] = "";
+    char portstr[7] = {0};
     if(host->proto == KRB5_KRBHST_TCP)
 	proto = "tcp/";
     else if(host->proto == KRB5_KRBHST_HTTP)
 	proto = "http://";
     if(host->port != host->def_port)
-	snprintf(portstr, sizeof(portstr), ":%d", host->port);
+	snprintf(portstr, sizeof(portstr), ":%hd", host->port);
     snprintf(hostname, hostlen, "%s%s%s", proto, host->hostname, portstr);
     return 0;
 }


-- 
Samba Shared Repository



More information about the samba-cvs mailing list