s3:rpc_server/svcctl: fix valgrind bug in _svcctl_QueryServiceObjectSecurity()
authorStefan Metzmacher <metze@samba.org>
Thu, 16 Jun 2011 10:47:22 +0000 (12:47 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 16 Jun 2011 12:15:47 +0000 (14:15 +0200)
r->out.buffer needs to stay in its size, as it will be marshalled completely.
As it's preallocated and initialized with zeros, we just need to copy
the payload into it, even if it's smaller than the offered buffer size.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jun 16 14:15:47 CEST 2011 on sn-devel-104

source3/rpc_server/svcctl/srv_svcctl_nt.c

index 8523def037b9e36843f315c40f9ca54bd5181e3a..f515906339f8ce407c3ec9d646e12b4cd497392d 100644 (file)
@@ -936,7 +936,7 @@ WERROR _svcctl_QueryServiceObjectSecurity(struct pipes_struct *p,
        }
 
        *r->out.needed = len;
-       r->out.buffer = buffer;
+       memcpy(r->out.buffer, buffer, len);
 
        return WERR_OK;
 }