r2580: fixed an uninitialised byte found by valgrind
authorAndrew Tridgell <tridge@samba.org>
Fri, 24 Sep 2004 03:31:43 +0000 (03:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:07 +0000 (12:59 -0500)
(This used to be commit 0806378b0e34ba3d665a9db739539819f3f52054)

source4/ntvfs/ipc/rap_server.c

index 4ab1915c81f682ed25d08d6f41367358c65cb052..b414b40d7ec88414980ce4d6f05c1be98bacfdc7 100644 (file)
@@ -32,12 +32,12 @@ NTSTATUS rap_netshareenum(struct smbsrv_request *req,
        r->out.info = talloc_array_p(req,
                                     union rap_shareenum_info, 2);
 
-       strncpy(r->out.info[0].info1.name, "C$", 12);
+       strncpy(r->out.info[0].info1.name, "C$", sizeof(r->out.info[0].info1.name));
        r->out.info[0].info1.pad = 0;
        r->out.info[0].info1.type = 0;
        r->out.info[0].info1.comment = talloc_strdup(req, "Bla");
        
-       strncpy(r->out.info[1].info1.name, "IPC$", 12);
+       strncpy(r->out.info[1].info1.name, "IPC$", sizeof(r->out.info[0].info1.name));
        r->out.info[1].info1.pad = 0;
        r->out.info[1].info1.type = 1;
        r->out.info[1].info1.comment = talloc_strdup(req, "Blub");