summaryrefslogtreecommitdiff
path: root/server/reds.c
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2017-05-15 15:57:28 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2017-07-11 11:14:10 +0200
commitec6229c79abe05d731953df5f7e9a05ec9f6df79 (patch)
tree124dc4e99cbd3a8f02bfc915e0c9f637f42f6bc4 /server/reds.c
parentf1e7ec03e26ab6b8ca9b7ec060846a5b706a963d (diff)
reds: Avoid integer overflows handling monitor configuration
Avoid VDAgentMessage::size integer overflows. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Diffstat (limited to 'server/reds.c')
-rw-r--r--server/reds.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/server/reds.c b/server/reds.c
index 7be85fdf..e1c8c108 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -1024,6 +1024,9 @@ static void reds_on_main_agent_monitors_config(
spice_debug("not enough data yet. %d", cmc->buffer_size);
return;
}
+ if (msg_header->size < sizeof(VDAgentMonitorsConfig)) {
+ goto overflow;
+ }
monitors_config = (VDAgentMonitorsConfig *)(cmc->buffer + sizeof(*msg_header));
spice_debug("%s: %d", __func__, monitors_config->num_of_monitors);
red_dispatcher_client_monitors_config(monitors_config);