stroke: Ensure a minimum message length

This commit is contained in:
Tobias Brunner
2018-03-19 18:06:00 +01:00
parent 04ede658c8
commit 0acd1ab4d0
@@ -627,6 +627,11 @@ static bool on_accept(private_stroke_socket_t *this, stream_t *stream)
}
return FALSE;
}
if (len < offsetof(stroke_msg_t, buffer))
{
DBG1(DBG_CFG, "invalid stroke message length %d", len);
return FALSE;
}
/* read message (we need an additional byte to terminate the buffer) */
msg = malloc(len + 1);