Skip to content
Snippets Groups Projects
Commit edac0884 authored by Pea Nut's avatar Pea Nut Committed by jkito
Browse files

[management] Improve error handling in *StateEvent.parts()

Create slice with a length of 6 when receiving an invalid management message.
This position holds the connected port.
parent a8b10af3
Branches
Tags
1 merge request!257Log port of connected OpenVPN gateway
......@@ -173,8 +173,8 @@ func (e *StateEvent) parts() [][]byte {
// Prevent crash if the server has sent us a malformed
// status message. This should never actually happen if
// the server is behaving itself.
if len(e.bodyParts) < 5 {
expanded := make([][]byte, 5)
if len(e.bodyParts) < 6 {
expanded := make([][]byte, 6)
copy(expanded, e.bodyParts)
e.bodyParts = expanded
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment