diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-10-31 02:58:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:45:32 -0500 |
commit | 6779373ec4eec8b2fe464b77b981f4e050a5766d (patch) | |
tree | 615b498bfdcebbbe0c461410b3a91cb221242799 /source4/torture | |
parent | b1d3d75c681d99f84aa2c60863597e32cdd24e66 (diff) | |
download | samba-6779373ec4eec8b2fe464b77b981f4e050a5766d.tar.gz samba-6779373ec4eec8b2fe464b77b981f4e050a5766d.tar.bz2 samba-6779373ec4eec8b2fe464b77b981f4e050a5766d.zip |
r11405: Ensure we can never have secret4 be uninitialised. Found after
volker's urging on the use of -O1.
Andrew Bartlett
(This used to be commit 6a7bb391ba62a4f90f57aa76c5dcc0d35fca54a4)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/lsa.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 4d53048d8e..7180986a65 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -797,13 +797,13 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, status = dcerpc_lsa_OpenSecret(p, mem_ctx, &r2); if (!NT_STATUS_IS_OK(status)) { printf("OpenSecret failed - %s\n", nt_errstr(status)); - ret = False; + return False; } status = dcerpc_fetch_session_key(p, &session_key); if (!NT_STATUS_IS_OK(status)) { printf("dcerpc_fetch_session_key failed - %s\n", nt_errstr(status)); - ret = False; + return False; } enc_key = sess_encrypt_string(secret1, &session_key); @@ -820,7 +820,7 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, status = dcerpc_lsa_SetSecret(p, mem_ctx, &r3); if (!NT_STATUS_IS_OK(status)) { printf("SetSecret failed - %s\n", nt_errstr(status)); - ret = False; + return False; } r3.in.sec_handle = &sec_handle; @@ -916,12 +916,14 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, if (!NT_STATUS_IS_OK(status)) { printf("QuerySecret failed - %s\n", nt_errstr(status)); ret = False; + secret4 = NULL; } else { if (r6.out.new_val->buf == NULL || r6.out.old_val->buf == NULL || r6.out.new_mtime == NULL || r6.out.old_mtime == NULL) { printf("Both secret buffers and both times not returned\n"); ret = False; + secret4 = NULL; } else { blob1.data = r6.out.new_val->buf->data; blob1.length = r6.out.new_val->buf->size; |