[gnome-settings-daemon] Check whether XGetWindowProperty returns no items, and return if so.



commit 89b4c4ca25f282a0440414a9ba55b12364b681b8
Author: Krzysztof Klimonda <kklimonda ubuntu com>
Date:   Wed Sep 15 12:29:17 2010 +0200

    Check whether XGetWindowProperty returns no items, and return if so.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=628526

 plugins/clipboard/gsd-clipboard-manager.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/clipboard/gsd-clipboard-manager.c b/plugins/clipboard/gsd-clipboard-manager.c
index f8cb7ec..d0d28c3 100644
--- a/plugins/clipboard/gsd-clipboard-manager.c
+++ b/plugins/clipboard/gsd-clipboard-manager.c
@@ -599,8 +599,11 @@ convert_clipboard (GsdClipboardManager *manager,
                                     &type, &format, &nitems, &remaining,
                                     (unsigned char **) &multiple);
 
-                if (type != XA_ATOM_PAIR)
+                if (type != XA_ATOM_PAIR || nitems == 0) {
+                        if (multiple)
+                                free (multiple);
                         return;
+                }
 
                 for (i = 0; i < nitems; i += 2) {
                         rdata = (IncrConversion *) malloc (sizeof (IncrConversion));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]