Fix silly bug introduced in 1.12.0 which breaks ntfsfix (and others

possibly) when calling ntfs_attr_lookup() with AT_UNNAMED name and
no ntfs inode in the search context.  (Anton)
edge.strict_endians
antona 2005-10-15 20:52:41 +00:00
parent a3ab2bc6a0
commit e46d4e8959
2 changed files with 7 additions and 4 deletions

View File

@ -9,6 +9,9 @@ xx/xx/2005 - 1.12.2-WIP
- Fix bogus le16_to_cpu() which shouldbe le32_to_cpu() when accessing
the attribute list entry attribute type in some places in
libntfs/attrib.c. (Anton)
- Fix silly bug introduced in 1.12.0 which breaks ntfsfix (and others
possibly) when calling ntfs_attr_lookup() with AT_UNNAMED name and
no ntfs inode in the search context. (Anton)
10/10/2005 - 1.12.1 - Minor fix to location of mount.ntfs-fuse and mkfs.ntfs.

View File

@ -1576,7 +1576,7 @@ static int ntfs_attr_find(const ATTR_TYPES type, const ntfschar *name,
upcase = vol->upcase;
upcase_len = vol->upcase_len;
} else {
if (name) {
if (name && name != AT_UNNAMED) {
errno = EINVAL;
return -1;
}
@ -2187,9 +2187,9 @@ int ntfs_attr_lookup(const ATTR_TYPES type, const ntfschar *name,
ntfs_volume *vol;
ntfs_inode *base_ni;
if (!ctx || !ctx->mrec || !ctx->attr || (name && (!ctx->ntfs_ino ||
!(vol = ctx->ntfs_ino->vol) || !vol->upcase ||
!vol->upcase_len))) {
if (!ctx || !ctx->mrec || !ctx->attr || (name && name != AT_UNNAMED &&
(!ctx->ntfs_ino || !(vol = ctx->ntfs_ino->vol) ||
!vol->upcase || !vol->upcase_len))) {
errno = EINVAL;
return -1;
}