smbd: unix_convert_step(). Fix use of state->end as a boolean, always compare with...
authorJeremy Allison <jra@samba.org>
Fri, 24 Apr 2020 20:55:49 +0000 (13:55 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 24 Apr 2020 23:21:16 +0000 (23:21 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 24 23:21:16 UTC 2020 on sn-devel-184

source3/smbd/filename.c

index 03c6a4b0a163e2cd2638192c00613de40f803dcb..f45a45c8c7f927c0ae9ce6eb69ecfe675b256ccd 100644 (file)
@@ -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 = '/';
        }