Fix Coverity bug #902, uninitialized variable.
authorJeremy Allison <jra@samba.org>
Thu, 23 Apr 2009 09:02:28 +0000 (02:02 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 23 Apr 2009 09:02:28 +0000 (02:02 -0700)
Jeremy.

source3/nmbd/nmbd_packets.c
source3/nmbd/nmbd_processlogon.c

index f69845b346c4b6c9586ba6cee76ba6a2bd150cfa..4045184f335dd98e73b82b2c43be91e4111b7cb4 100644 (file)
@@ -1936,7 +1936,9 @@ bool send_mailslot(bool unique, const char *mailslot,char *buf, size_t len,
                DEBUG(0, ("send_mailslot: Cannot write beyond end of packet\n"));
                return False;
        } else {
                DEBUG(0, ("send_mailslot: Cannot write beyond end of packet\n"));
                return False;
        } else {
-               memcpy(p2,buf,len);
+               if (len) {
+                       memcpy(p2,buf,len);
+               }
                p2 += len;
        }
 
                p2 += len;
        }
 
index 8173337da07ca74fe2cfcbea203f131ddf78806e..43e80af394de3ec32b0334be8f8d1024bf8f1629 100644 (file)
@@ -267,7 +267,7 @@ static void nmbd_proxy_logon_done(struct tevent_req *subreq)
                tevent_req_callback_data(subreq,
                struct nmbd_proxy_logon_state);
        NTSTATUS status;
                tevent_req_callback_data(subreq,
                struct nmbd_proxy_logon_state);
        NTSTATUS status;
-       DATA_BLOB response;
+       DATA_BLOB response = data_blob_null;
 
        status = cldap_netlogon_recv(subreq, NULL, state, &state->io);
        if (!NT_STATUS_IS_OK(status)) {
 
        status = cldap_netlogon_recv(subreq, NULL, state, &state->io);
        if (!NT_STATUS_IS_OK(status)) {