diff options
author | Rui Matos <tiagomatos@gmail.com> | 2015-10-05 17:53:57 +0200 |
---|---|---|
committer | Rui Matos <tiagomatos@gmail.com> | 2015-10-06 22:33:42 +0200 |
commit | 54557f062e15e13de2e351eae02ed54f28068102 (patch) | |
tree | ddf4da5e7c0586574a010ba606440f1464a95b5e | |
parent | 130807a30803e1d691b613be074d8414c630dce9 (diff) | |
download | mutter-54557f062e15e13de2e351eae02ed54f28068102.tar.gz |
xprops: Fix reading Window and XSyncCounter properties
Both Window and XSyncCounter are XIDs which on 64 bit X clients are 8
bytes wide. But the values on the wire are 32 bit so, for these types,
we always copy 4 bytes into results->prop. As such copying them out
with a cast such as *(Window *) means that we are actually reading 8
bytes which depending on whether the higher addressed 4 bytes are zero
means that sometimes this works while others it gives us a bogus
value.
https://bugzilla.gnome.org/show_bug.cgi?id=756074
-rw-r--r-- | src/x11/xprops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/x11/xprops.c b/src/x11/xprops.c index 589d53810..be3882455 100644 --- a/src/x11/xprops.c +++ b/src/x11/xprops.c @@ -507,7 +507,7 @@ window_from_results (GetPropertyResults *results, if (!validate_or_free_results (results, 32, XA_WINDOW, TRUE)) return FALSE; - *window_p = *(Window*) results->prop; + *window_p = *(uint32_t *) results->prop; g_free (results->prop); results->prop = NULL; @@ -523,7 +523,7 @@ counter_from_results (GetPropertyResults *results, TRUE)) return FALSE; - *counter_p = *(XSyncCounter*) results->prop; + *counter_p = *(uint32_t *) results->prop; g_free (results->prop); results->prop = NULL; |