From c83038b4b3860dfd3516e0e993b9c91615bd1f83 Mon Sep 17 00:00:00 2001 From: Norbert Federa Date: Mon, 17 Oct 2011 15:39:06 +0200 Subject: [PATCH] xfreerdp: fix xf_GetWindowProperty xf_GetWindowProperty should return False if the specified property does not exist. It is not sufficient to simply check for the return value of XGetWindowProperty. XGetWindowProperty also returns Success if the specified property does not exist. However, it will return "None" to the actual_type_return parameter in that case. This change fixes several crashes with some (exotic) window managers. --- client/X11/xf_window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index 478fcce99..692ede0e8 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -95,6 +95,12 @@ boolean xf_GetWindowProperty(xfInfo* xfi, Window window, Atom property, int leng if (status != Success) return False; + if (actual_type == None) + { + DEBUG_WARN("Property %lu does not exist", property); + return False; + } + return True; }