summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-19 20:00:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:18:49 -0500
commit3d672717e084f7a26ef60321d614a686dd803dbd (patch)
treeadad627c8157ce4dae9e1b9a7b68003d5c30680f
parenta70bbb921a078b5f4ab9928168c9308e2bb05933 (diff)
downloadsamba-3d672717e084f7a26ef60321d614a686dd803dbd.tar.gz
samba-3d672717e084f7a26ef60321d614a686dd803dbd.tar.bz2
samba-3d672717e084f7a26ef60321d614a686dd803dbd.zip
r16363: Fix Klocwork ID 981 1652
Volker (This used to be commit ce1d8423ef7cd86fc64200002fde707bca621d44)
-rw-r--r--source3/libsmb/trusts_util.c6
-rw-r--r--source3/utils/ntlm_auth_diagnostics.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index 9d94c1d00a..55108bf72f 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -86,7 +86,11 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
/* Create a random machine account password */
str = generate_random_str(DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
- new_trust_passwd = talloc_strdup(mem_ctx, str);
+
+ if ((new_trust_passwd = talloc_strdup(mem_ctx, str)) == NULL) {
+ DEBUG(0, ("talloc_strdup failed\n"));
+ return NT_STATUS_NO_MEMORY;
+ }
E_md4hash(new_trust_passwd, new_trust_passwd_hash);
diff --git a/source3/utils/ntlm_auth_diagnostics.c b/source3/utils/ntlm_auth_diagnostics.c
index 00149db9e2..c8ea966a55 100644
--- a/source3/utils/ntlm_auth_diagnostics.c
+++ b/source3/utils/ntlm_auth_diagnostics.c
@@ -464,7 +464,10 @@ static BOOL test_plaintext(enum ntlm_break break_which)
nt_response.length = strlen_w(((void *)nt_response.data))*sizeof(smb_ucs2_t);
- password = strdup_upper(opt_password);
+ if ((password = strdup_upper(opt_password)) == NULL) {
+ DEBUG(0, ("strdup_upper failed!\n"));
+ exit(1);
+ }
if ((convert_string_allocate(NULL, CH_UNIX,
CH_DOS, password,