From b70f23c2b581c5d455362ab37f4846de9a910055 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Aug 2012 17:01:00 -0700 Subject: Correctly check for errors in strlower_m() returns. --- source3/smbd/negprot.c | 2 +- source3/smbd/service.c | 6 +++++- source3/smbd/smb2_tcon.c | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) (limited to 'source3/smbd') 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)) { -- cgit