[Spice-devel] [vdagent-linux v8 2/4] Add missing size checks
Victor Toso
victortoso at redhat.com
Wed Feb 15 09:59:15 UTC 2017
On Wed, Feb 15, 2017 at 10:48:05AM +0100, Victor Toso wrote:
> From: Christophe Fergeau <cfergeau at redhat.com>
Maybe include vdagentd: prefix in the commit log?
Acked-by: Victor Toso <victortoso at redhat.com>
>
> ---
> src/vdagentd/vdagentd.c | 14 ++++++--------
> 1 file changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/src/vdagentd/vdagentd.c b/src/vdagentd/vdagentd.c
> index ea8482b..8d43700 100644
> --- a/src/vdagentd/vdagentd.c
> +++ b/src/vdagentd/vdagentd.c
> @@ -391,6 +391,8 @@ static gboolean vdagent_message_check_size(const VDAgentMessage *message_header)
>
> switch (message_header->type) {
> case VD_AGENT_MONITORS_CONFIG:
> + case VD_AGENT_FILE_XFER_START:
> + case VD_AGENT_FILE_XFER_DATA:
> case VD_AGENT_CLIPBOARD:
> case VD_AGENT_CLIPBOARD_GRAB:
> case VD_AGENT_CLIPBOARD_REQUEST:
> @@ -404,21 +406,17 @@ static gboolean vdagent_message_check_size(const VDAgentMessage *message_header)
> }
> break;
> case VD_AGENT_MOUSE_STATE:
> + case VD_AGENT_FILE_XFER_STATUS:
> + case VD_AGENT_DISPLAY_CONFIG:
> + case VD_AGENT_REPLY:
> case VD_AGENT_MAX_CLIPBOARD:
> + case VD_AGENT_CLIENT_DISCONNECTED:
> if (message_header->size != min_size) {
> syslog(LOG_ERR, "read: invalid message size: %u for message type: %u",
> message_header->size, message_header->type);
> return FALSE;
> }
> break;
> - case VD_AGENT_FILE_XFER_START:
> - case VD_AGENT_FILE_XFER_DATA:
> - case VD_AGENT_FILE_XFER_STATUS:
> - case VD_AGENT_CLIENT_DISCONNECTED:
> - /* No size checks for these at the moment */
> - break;
> - case VD_AGENT_DISPLAY_CONFIG:
> - case VD_AGENT_REPLY:
> default:
> g_warn_if_reached();
> return FALSE;
> --
> 2.9.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170215/9bd112a4/attachment.sig>
More information about the Spice-devel
mailing list