mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-07-08 18:16:24 +00:00
[ISO9660] Fix when 0-length file indicates it has an extended attribute (yet it doesn't, it doesn't have an extent where to put it).
This commit is contained in:
@@ -547,6 +547,8 @@ public sealed partial class ISO9660
|
||||
if(entry.CdiSystemArea.Value.attributes.HasFlag(CdiAttributes.OwnerRead)) stat.Mode |= 256;
|
||||
}
|
||||
|
||||
if(entry.Extents.Count == 0) return ErrorNumber.NoError;
|
||||
|
||||
ErrorNumber errno = ReadSingleExtent(entry.XattrLength * _blockSize, entry.Extents[0].extent, out byte[] ea);
|
||||
|
||||
if(errno != ErrorNumber.NoError) return ErrorNumber.NoError;
|
||||
|
||||
@@ -103,11 +103,16 @@ public sealed partial class ISO9660
|
||||
switch(xattr)
|
||||
{
|
||||
case Xattrs.XATTR_ISO9660_EA:
|
||||
return entry.XattrLength == 0
|
||||
? ErrorNumber.NoSuchExtendedAttribute
|
||||
: entry.Extents is null
|
||||
? ErrorNumber.InvalidArgument
|
||||
: ReadSingleExtent(entry.XattrLength * _blockSize, entry.Extents[0].extent, out buf);
|
||||
if(entry.XattrLength == 0) return ErrorNumber.NoSuchExtendedAttribute;
|
||||
|
||||
if(entry.Extents is null) return ErrorNumber.InvalidArgument;
|
||||
|
||||
if(entry.Extents.Count > 1)
|
||||
return ReadSingleExtent(entry.XattrLength * _blockSize, entry.Extents[0].extent, out buf);
|
||||
|
||||
buf = [];
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
|
||||
case Xattrs.XATTR_ISO9660_ASSOCIATED_FILE:
|
||||
if(entry.AssociatedFile is null) return ErrorNumber.NoSuchExtendedAttribute;
|
||||
|
||||
Reference in New Issue
Block a user