summaryrefslogtreecommitdiff
path: root/source3/smbd
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/smbd
parentce21d0804012da27cec72abe896352d7f0e7e1e5 (diff)
downloadsamba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.gz
samba-b70f23c2b581c5d455362ab37f4846de9a910055.tar.bz2
samba-b70f23c2b581c5d455362ab37f4846de9a910055.zip
Correctly check for errors in strlower_m() returns.
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/negprot.c2
-rw-r--r--source3/smbd/service.c6
-rw-r--r--source3/smbd/smb2_tcon.c5
3 files changed, 10 insertions, 3 deletions
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index c9350afa49..e33350c932 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -206,7 +206,7 @@ DATA_BLOB negprot_spnego(TALLOC_CTX *ctx, struct smbd_server_connection *sconn)
memset(blob_out.data, '\0', 16);
checked_strlcpy(unix_name, lp_netbios_name(), sizeof(unix_name));
- strlower_m(unix_name);
+ (void)strlower_m(unix_name);
push_ascii_nstring(dos_name, unix_name);
strlcpy((char *)blob_out.data, dos_name, 17);
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index ce9cff90e2..0cd48f8950 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -1098,7 +1098,11 @@ connection_struct *make_connection(struct smbd_server_connection *sconn,
return NULL;
}
- strlower_m(service);
+ if (!strlower_m(service)) {
+ DEBUG(2, ("strlower_m %s failed\n", service));
+ *status = NT_STATUS_INVALID_PARAMETER;
+ return NULL;
+ }
snum = find_service(talloc_tos(), service, &service);
if (!service) {
diff --git a/source3/smbd/smb2_tcon.c b/source3/smbd/smb2_tcon.c
index 2cf91af3ff..1346d1309b 100644
--- a/source3/smbd/smb2_tcon.c
+++ b/source3/smbd/smb2_tcon.c
@@ -202,7 +202,10 @@ static NTSTATUS smbd_smb2_tree_connect(struct smbd_smb2_request *req,
return NT_STATUS_NO_MEMORY;
}
- strlower_m(service);
+ if (!strlower_m(service)) {
+ DEBUG(2, ("strlower_m %s failed\n", service));
+ return NT_STATUS_INVALID_PARAMETER;
+ }
/* TODO: do more things... */
if (strequal(service,HOMES_NAME)) {