Fixed a possible null dereference when creating a stream

PERMISSION_HANDLING_BRANCH
Jean-Pierre André 2010-06-18 13:59:06 +02:00
parent 29f760f7e7
commit f2f4e8dc07
1 changed files with 3 additions and 1 deletions

View File

@ -1775,10 +1775,12 @@ static int ntfs_fuse_create_stream(const char *path,
}
if (ntfs_attr_add(ni, AT_DATA, stream_name, stream_name_len, NULL, 0))
res = -errno;
else
set_archive(ni);
if ((res >= 0)
&& fi
&& (fi->flags & (O_WRONLY | O_RDWR))) {
set_archive(ni);
/* mark a future need to compress the last block */
if (ni->flags & FILE_ATTR_COMPRESSED)
fi->fh |= CLOSE_COMPRESSED;