From: Jeremy Allison Date: Fri, 24 Apr 2020 20:55:49 +0000 (-0700) Subject: smbd: unix_convert_step(). Fix use of state->end as a boolean, always compare with... X-Git-Tag: ldb-2.2.0~874 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7dfe87ac64f5867e587e9f252cf0d6f41f01c63;p=thirdparty%2Fsamba.git smbd: unix_convert_step(). Fix use of state->end as a boolean, always compare with NULL. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Apr 24 23:21:16 UTC 2020 on sn-devel-184 --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 03c6a4b0a16..f45a45c8c7f 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -800,7 +800,7 @@ static NTSTATUS unix_convert_step(struct uc_state *state) /* * Chop the name at this point. */ - if (state->end) { + if (state->end != NULL) { *state->end = 0; } @@ -809,7 +809,7 @@ static NTSTATUS unix_convert_step(struct uc_state *state) /* The name cannot have a component of "." */ if (ISDOT(state->name)) { - if (!state->end) { + if (state->end == NULL) { /* Error code at the end of a pathname. */ return NT_STATUS_OBJECT_NAME_INVALID; } @@ -826,7 +826,7 @@ static NTSTATUS unix_convert_step(struct uc_state *state) } /* Wildcards never valid within a pathname. */ - if (state->name_has_wildcard && state->end) { + if (state->name_has_wildcard && state->end != NULL) { return NT_STATUS_OBJECT_NAME_INVALID; } @@ -876,7 +876,7 @@ static NTSTATUS unix_convert_step(struct uc_state *state) /* * Restore the / that we wiped out earlier. */ - if (state->end) { + if (state->end != NULL) { *state->end = '/'; }