- Make ntfs_attr_open() make a copy of the attribute name unless it is

one of the internal names.  (Anton)

(Logical change 1.570)
edge.strict_endians
cantab.net!aia21 2004-09-20 14:46:38 +00:00
parent 48c44604f1
commit 9f2f8ad317
1 changed files with 9 additions and 0 deletions

View File

@ -341,6 +341,15 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni, const ATTR_TYPES type,
na = calloc(sizeof(ntfs_attr), 1);
if (!na)
return NULL;
if (name && name != AT_UNNAMED && name != I30) {
name = ntfs_ucsndup(name, name_len);
if (!name) {
err = errno;
free(na);
errno = err;
return NULL;
}
}
__ntfs_attr_init(na, ni, type, name, name_len);
ctx = ntfs_attr_get_search_ctx(ni, NULL);