Skip to content

Commit c6cee51

Browse files
authored
Merge pull request #52 from TheManticoreProject/fix/ace-unmarshal-return-header-size
[enhancement] Return ACE header size from Unmarshal instead of parsed byte count
2 parents 9642d38 + 25937a7 commit c6cee51

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ace/AccessControlEntry.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,11 @@ func (ace *AccessControlEntry) Unmarshal(marshalledData []byte) (int, error) {
546546
return 0, fmt.Errorf("unknown ACE type: %d", ace.Header.Type.Value)
547547
}
548548

549-
return int(ace.RawBytesSize), nil
549+
// Return the full ACE size from the header, not just the bytes we parsed.
550+
// ACE types with ApplicationData (callback, resource attribute, scoped policy)
551+
// have trailing data beyond what we explicitly parse, and the caller needs
552+
// the full size to correctly advance to the next ACE.
553+
return int(ace.Header.Size), nil
550554
}
551555

552556
// Marshal serializes the AccessControlEntry struct into a byte slice.

0 commit comments

Comments
 (0)