mirror of
https://github.com/mandiant/gopacket
synced 2026-06-21 13:57:02 +00:00
Merge pull request #24 from Jah-yee/fix-ace-parsepanic
security: reject ACE with AceSize below minimum header size
This commit is contained in:
@@ -48,6 +48,9 @@ func ParseACE(data []byte) (*ACE, int, error) {
|
||||
Flags: data[1],
|
||||
}
|
||||
aceSize := int(binary.LittleEndian.Uint16(data[2:4]))
|
||||
if aceSize < 8 {
|
||||
return nil, 0, fmt.Errorf("ACE size %d is below minimum header size of 8", aceSize)
|
||||
}
|
||||
if len(data) < aceSize {
|
||||
return nil, 0, fmt.Errorf("ACE size %d exceeds available data %d", aceSize, len(data))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user