From: Frediano Ziglio <fziglio@xxxxxxxxxx> Avoid VDAgentMessage::size integer overflows. Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> --- server/reds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/reds.c b/server/reds.c index ec2b6f475..656f518ff 100644 --- a/server/reds.c +++ b/server/reds.c @@ -1131,6 +1131,9 @@ static void reds_on_main_agent_monitors_config(RedsState *reds, spice_debug("not enough data yet. %zd", cmc->offset); return; } + if (msg_header->size < sizeof(VDAgentMonitorsConfig)) { + goto overflow; + } monitors_config = (VDAgentMonitorsConfig *)(cmc->buffer + sizeof(*msg_header)); spice_debug("monitors_config->num_of_monitors: %d", monitors_config->num_of_monitors); reds_client_monitors_config(reds, monitors_config); -- 2.13.0 _______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel