udf_readatoffset: return correct size and data pointer for data in fentry
This should help correct reading of directories with data located in fentry. Submitted by: bde Approved by: jhb (mentor)
This commit is contained in:
parent
ee3e3ff5c2
commit
b2c91b67b6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189111
@ -1319,6 +1319,12 @@ udf_readatoffset(struct udf_node *node, int *size, off_t offset,
|
||||
fentry = node->fentry;
|
||||
*data = &fentry->data[le32toh(fentry->l_ea)];
|
||||
*size = le32toh(fentry->l_ad);
|
||||
if (offset >= *size)
|
||||
*size = 0;
|
||||
else {
|
||||
*data += offset;
|
||||
*size -= offset;
|
||||
}
|
||||
return (0);
|
||||
} else if (error != 0) {
|
||||
return (error);
|
||||
|
Loading…
Reference in New Issue
Block a user