summaryrefslogtreecommitdiff
path: root/source3/lib/substitute.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-08-08 17:01:00 -0700
committerJeremy Allison <jra@samba.org>2012-08-09 12:08:18 -0700
commitb70f23c2b581c5d455362ab37f4846de9a910055 (patch)
treecf95e8d35a03d1e39d5926d2e03d7046d42cae64 /source3/lib/substitute.c
parentce21d0804012da27cec72abe896352d7f0e7e1e5 (diff)
downloadsamba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.gz
Correctly check for errors in strlower_m() returns.
Diffstat (limited to 'source3/lib/substitute.c')
-rw-r--r--source3/lib/substitute.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index 44582860a19..a254bcaa7d5 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -66,7 +66,10 @@ bool set_local_machine_name(const char *local_name, bool perm)
/* alpha_strcpy includes the space for the terminating nul. */
alpha_strcpy(local_machine,tmp_local_machine,
SAFE_NETBIOS_CHARS,len+1);
- strlower_m(local_machine);
+ if (!strlower_m(local_machine)) {
+ TALLOC_FREE(tmp_local_machine);
+ return false;
+ }
TALLOC_FREE(tmp_local_machine);
already_perm = perm;
@@ -118,7 +121,10 @@ bool set_remote_machine_name(const char *remote_name, bool perm)
/* alpha_strcpy includes the space for the terminating nul. */
alpha_strcpy(remote_machine,tmp_remote_machine,
SAFE_NETBIOS_CHARS,len+1);
- strlower_m(remote_machine);
+ if (!strlower_m(remote_machine)) {
+ TALLOC_FREE(tmp_remote_machine);
+ return false;
+ }
TALLOC_FREE(tmp_remote_machine);
already_perm = perm;
@@ -153,7 +159,10 @@ void sub_set_smb_name(const char *name)
return;
}
trim_char(tmp, ' ', ' ');
- strlower_m(tmp);
+ if (!strlower_m(tmp)) {
+ TALLOC_FREE(tmp);
+ return;
+ }
len = strlen(tmp);