The branch, master has been updated
       via  68c7c19a0fb utils: Fix CID 1638831 Division or modulo by zero
       via  4d7689e57e2 utils: Fix CID 242227 resource leak
      from  16d32aa2562 libsmb: Modernize two DEBUGs

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


- Log -----------------------------------------------------------------
commit 68c7c19a0fb3f7c9124d77674fee5affb8a8ab02
Author: Shwetha K Acharya <shwetha.k.acha...@ibm.com>
Date:   Mon May 5 13:17:05 2025 +0530

    utils: Fix CID 1638831 Division or modulo by zero
    
    The conditions now == start or pos == start_pos are checked
    at the beginning of the function definition to ensure that avg
    is non zero.
    Also an appropriate print statement is added to indicate
    the print status.
    
    Signed-off-by: Shwetha K Acharya <shwetha.k.acha...@ibm.com>
    Reviewed-by: Anoop C S <anoo...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>
    
    Autobuild-User(master): Volker Lendecke <v...@samba.org>
    Autobuild-Date(master): Fri May 16 07:10:57 UTC 2025 on atb-devel-224

commit 4d7689e57e233563b331904120db77c536f35ab6
Author: Shwetha K Acharya <shwetha.k.acha...@ibm.com>
Date:   Fri May 9 15:16:19 2025 +0530

    utils: Fix CID 242227 resource leak
    
    Signed-off-by: Shwetha K Acharya <shwetha.k.acha...@ibm.com>
    Reviewed-by: Anoop C S <anoo...@samba.org>
    Reviewed-by: Volker Lendecke <v...@samba.org>

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

Summary of changes:
 source3/utils/net_ads_join_dns.c | 1 +
 source3/utils/smbget.c           | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/net_ads_join_dns.c b/source3/utils/net_ads_join_dns.c
index 88287963dcf..aaa0ca9885e 100644
--- a/source3/utils/net_ads_join_dns.c
+++ b/source3/utils/net_ads_join_dns.c
@@ -228,6 +228,7 @@ NTSTATUS net_update_dns_ext(struct net_context *c,
                if ( num_addrs <= 0 ) {
                        DEBUG(4, ("net_update_dns_ext: Failed to find my "
                                  "non-loopback IP addresses!\n"));
+                       SAFE_FREE(iplist_alloc);
                        return NT_STATUS_INVALID_PARAMETER;
                }
                iplist = iplist_alloc;
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 67ea259afb8..a9899bafa13 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -315,9 +315,12 @@ static void print_progress(const char *name, time_t start, 
time_t now,
        char hpos[22], htotal[22], havg[22];
        char *status, *filename;
        int len;
-       if (now - start) {
-               avg = 1.0 * (pos - start_pos) / (now - start);
+
+       if (now == start || pos == start_pos) {
+               fprintf(stderr, "\r[%s] No progress yet", name);
+               return;
        }
+       avg = 1.0 * (pos - start_pos) / (now - start);
        eta = (total - pos) / avg;
        if (total) {
                prcnt = 100.0 * pos / total;


-- 
Samba Shared Repository

Reply via email to