Bug 13162 - Un-declared/itialized variable in vfs_zfsacl.c
Un-declared/itialized variable in vfs_zfsacl.c
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
4.7.1
All All
: P5 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-11-23 11:11 UTC by Jura Sasek
Modified: 2017-11-23 11:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jura Sasek 2017-11-23 11:11:02 UTC
In:

static NTSTATUS zfs_get_nt_acl_common(struct connection_struct *conn,
                                      TALLOC_CTX *mem_ctx,
                                      const struct smb_filename *smb_fname,
                                      struct SMB4ACL_T **ppacl)
{
        int naces, i;
        ace_t *acebuf;
        struct SMB4ACL_T *pacl;
        SMB_STRUCT_STAT sbuf;
        const SMB_STRUCT_STAT *psbuf = NULL;
        int ret;

        if (VALID_STAT(smb_fname->st)) {
                psbuf = &smb_fname->st;
        }

        if (psbuf == NULL) {
                ret = vfs_stat_smb_basename(conn, smb_fname, &sbuf);
                if (ret != 0) {
                        DBG_INFO("stat [%s]failed: %s\n",
                                 smb_fname_str_dbg(smb_fname), strerror(errno));
                        return map_nt_error_from_unix(errno);
                }
                psbuf = &sbuf;
        }

        if (S_ISDIR(psbuf->st_ex_mode) && (ace->aceMask & SMB_ACE4_ADD_FILE)) {
                ace->aceMask |= SMB_ACE4_DELETE_CHILD;
        }

the variable "ace" is not declared/initialized before the pointer dereference.

Most probably this was caused while "cherry-picking to 4.6 and 4.7" of the fix of the bug 6133

Thank you very much for cherry re-picking the fix again  :-)