Skip to content

Commit

Permalink
fix AMF crash on malformed NAS message (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
NaivEPoi authored Jan 9, 2024
1 parent 68013ee commit 9458f79
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/nas/nas_security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ func DecodePlainNasNoIntegrityCheck(payload []byte) (*nas.Message, error) {

if msg.SecurityHeaderType != nas.SecurityHeaderTypePlainNas {
// remove security Header
if len(payload) < 7 {
return nil, fmt.Errorf("nas payload is too short")
}
payload = payload[7:]
}

Expand Down

0 comments on commit 9458f79

Please sign in to comment.