[Spice-devel] [spice-gtk 2/2] cursor: don't access unitialized data when logging
Christophe Fergeau
cfergeau at redhat.com
Thu Sep 13 09:01:19 PDT 2012
SpiceCursor::header is only valid when SPICE_CURSOR_FLAGS_NONE is
not set in SpiceCursor::flags, so don't try to log info about
the header before we have tested this flag.
---
gtk/channel-cursor.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/gtk/channel-cursor.c b/gtk/channel-cursor.c
index 45e78c6..99e7a48 100644
--- a/gtk/channel-cursor.c
+++ b/gtk/channel-cursor.c
@@ -337,13 +337,15 @@ static display_cursor *set_cursor(SpiceChannel *channel, SpiceCursor *scursor)
guint8 *rgba;
guint8 val;
- CHANNEL_DEBUG(channel, "%s: type %d, %" PRIx64 ", %dx%d, flags %d, size %d",
- __FUNCTION__, hdr->type, hdr->unique, hdr->width, hdr->height,
- scursor->flags, scursor->data_size);
+ CHANNEL_DEBUG(channel, "%s: flags %d, size %d", __FUNCTION__,
+ scursor->flags, scursor->data_size);
if (scursor->flags & SPICE_CURSOR_FLAGS_NONE)
return NULL;
+ CHANNEL_DEBUG(channel, "%s: type %d, %" PRIx64 ", %dx%d", __FUNCTION__,
+ hdr->type, hdr->unique, hdr->width, hdr->height);
+
if (scursor->flags & SPICE_CURSOR_FLAGS_FROM_CACHE) {
item = cache_find(&c->cursors, hdr->unique);
g_return_val_if_fail(item != NULL, NULL);
--
1.7.11.4
More information about the Spice-devel
mailing list