From 9f2f8ad3179a2dc229b07def724913e1354b6be6 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Mon, 20 Sep 2004 14:46:38 +0000 Subject: [PATCH] - Make ntfs_attr_open() make a copy of the attribute name unless it is one of the internal names. (Anton) (Logical change 1.570) --- libntfs/attrib.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libntfs/attrib.c b/libntfs/attrib.c index a368954a..14ceb04e 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -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);