Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packet: fix software version capability parser #2735

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/packet/bgp/bgp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,11 @@
}
softwareVersionLen := uint8(data[0])
c.SoftwareVersionLen = softwareVersionLen
c.SoftwareVersion = string(data[1:c.SoftwareVersionLen])
data = data[1:]
if len(data) < c.SoftwareVersionLen {

Check failure on line 1098 in pkg/packet/bgp/bgp.go

View workflow job for this annotation

GitHub Actions / build container image

invalid operation: len(data) < c.SoftwareVersionLen (mismatched types int and uint8)

Check failure on line 1098 in pkg/packet/bgp/bgp.go

View workflow job for this annotation

GitHub Actions / embeded

invalid operation: len(data) < c.SoftwareVersionLen (mismatched types int and uint8)

Check failure on line 1098 in pkg/packet/bgp/bgp.go

View workflow job for this annotation

GitHub Actions / crossbuild (freebsd, amd64)

invalid operation: len(data) < c.SoftwareVersionLen (mismatched types int and uint8)

Check failure on line 1098 in pkg/packet/bgp/bgp.go

View workflow job for this annotation

GitHub Actions / unit

invalid operation: len(data) < c.SoftwareVersionLen (mismatched types int and uint8)

Check failure on line 1098 in pkg/packet/bgp/bgp.go

View workflow job for this annotation

GitHub Actions / unit386

invalid operation: len(data) < c.SoftwareVersionLen (mismatched types int and uint8)
return NewMessageError(BGP_ERROR_OPEN_MESSAGE_ERROR, BGP_ERROR_SUB_UNSUPPORTED_CAPABILITY, nil, "Not all CapabilitySoftwareVersion bytes allowed")
}
c.SoftwareVersion = string(data[:c.SoftwareVersionLen])
return nil
}

Expand Down
Loading