diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-10-19 11:27:32 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2011-10-19 11:28:20 +0200 |
commit | 06caae141c9bf30cd5271daf6af9ea0280ba1d5b (patch) | |
tree | 37f3f66c06d46cff11d751332bcafe777af89569 /gtk | |
parent | 0e37bf2897dd6540ed19fa6e6eddb9c2e0f03dbb (diff) | |
download | spice-gtk-06caae141c9bf30cd5271daf6af9ea0280ba1d5b.tar.gz spice-gtk-06caae141c9bf30cd5271daf6af9ea0280ba1d5b.tar.xz spice-gtk-06caae141c9bf30cd5271daf6af9ea0280ba1d5b.zip |
do not segfault if link message header size is set to 0
https://bugs.freedesktop.org/show_bug.cgi?id=41988
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/spice-channel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c index 5bc244f..23c16e7 100644 --- a/gtk/spice-channel.c +++ b/gtk/spice-channel.c @@ -976,6 +976,11 @@ static void spice_channel_recv_link_hdr(SpiceChannel *channel) } c->peer_msg = spice_malloc(c->peer_hdr.size); + if (c->peer_msg == NULL) { + g_critical("invalid peer header size: %u", c->peer_hdr.size); + goto error; + } + c->state = SPICE_CHANNEL_STATE_LINK_MSG; return; |