summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-02-08 15:33:51 +0100
committerGünther Deschner <gd@samba.org>2011-02-10 17:47:04 +0100
commitf0a90551b279c2dc7ab9d4c0e4b16b3e724548e2 (patch)
tree4186d89b7fad817eaa11a030da54fc23079a090d /source3/rpc_server
parent82bcada6f6c95f0b9c77c099566678c0f651d846 (diff)
downloadsamba-f0a90551b279c2dc7ab9d4c0e4b16b3e724548e2.tar.gz
samba-f0a90551b279c2dc7ab9d4c0e4b16b3e724548e2.tar.bz2
samba-f0a90551b279c2dc7ab9d4c0e4b16b3e724548e2.zip
s3-rpc_server: Fixed possible segfaults in svcctl server.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_svcctl_reg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_svcctl_reg.c b/source3/rpc_server/srv_svcctl_reg.c
index 7de47d8927..ca6a68a2fd 100644
--- a/source3/rpc_server/srv_svcctl_reg.c
+++ b/source3/rpc_server/srv_svcctl_reg.c
@@ -483,6 +483,7 @@ static bool svcctl_add_service(TALLOC_CTX *mem_ctx,
if (is_valid_policy_hnd(&key_hnd)) {
dcerpc_winreg_CloseKey(h, mem_ctx, &key_hnd, &result);
}
+ ZERO_STRUCT(key_hnd);
ZERO_STRUCT(wkey);
wkey.name = talloc_asprintf(mem_ctx, "%s\\%s\\Security", key, name);
@@ -564,7 +565,13 @@ bool svcctl_init_winreg(struct messaging_context *msg_ctx)
DEBUG(3, ("Initialise the svcctl registry keys if needed.\n"));
+ ZERO_STRUCT(hive_hnd);
+ ZERO_STRUCT(key_hnd);
+
key = talloc_strdup(tmp_ctx, TOP_LEVEL_SERVICES_KEY);
+ if (key == NULL) {
+ goto done;
+ }
status = dcerpc_winreg_int_hklm_openkey(tmp_ctx,
get_server_info_system(),
@@ -653,6 +660,7 @@ bool svcctl_init_winreg(struct messaging_context *msg_ctx)
if (is_valid_policy_hnd(&key_hnd)) {
dcerpc_winreg_CloseKey(h, tmp_ctx, &key_hnd, &result);
}
+ ZERO_STRUCT(key_hnd);
if (!ok) {
goto done;