From c13887defc4c05b6b87f8f40ae0cf981a497f443 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 8 Aug 2012 15:49:34 -0700 Subject: Check error returns on strnorm(). --- source3/smbd/filename.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index a4f9cd1bf6..0be566f897 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -323,7 +323,11 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, if (conn->case_sensitive && !conn->case_preserve && !conn->short_case_preserve) { - strnorm(smb_fname->base_name, lp_defaultcase(SNUM(conn))); + if (!strnorm(smb_fname->base_name, lp_defaultcase(SNUM(conn)))) { + DEBUG(0, ("strnorm %s failed\n", smb_fname->base_name)); + status = NT_STATUS_INVALID_PARAMETER; + goto err; + } } /* @@ -740,8 +744,13 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, (mangle_is_8_3(start, False, conn->params) && !conn->short_case_preserve)) { - strnorm(start, - lp_defaultcase(SNUM(conn))); + if (!strnorm(start, + lp_defaultcase(SNUM(conn)))) { + DEBUG(0, ("strnorm %s failed\n", + start)); + status = NT_STATUS_INVALID_PARAMETER; + goto err; + } } /* -- cgit