From 698270c47b3b78e3e746c4767a277c5e1e73ec14 Mon Sep 17 00:00:00 2001 From: Ander Conselvan de Oliveira Date: Mon, 31 Jan 2011 14:02:12 +0200 Subject: XlibInt: info_list->watch_data was reallocated, but result was discarded MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit info_list->watch_data was being reallocated, but the return value of the reallocation was stored only into a local variable. This might cause some funky behavior and crashes. Variable "wd_array" goes out of scope Value "wd_array" is overwritten in "wd_array = (XPointer*)realloc((char*)info_list->watch_data, (((dpy->watcher_count + 1) * 4U == 0U) ? 1U : ((dpy->watcher_count + 1) * 4U)))" Reviewed-by: Alan Coopersmith Reviewed-by: Erkki Seppälä Signed-off-by: Ander Conselvan de Oliveira Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/XlibInt.c | 1 + 1 file changed, 1 insertion(+) (limited to 'nx-X11/lib/X11/XlibInt.c') diff --git a/nx-X11/lib/X11/XlibInt.c b/nx-X11/lib/X11/XlibInt.c index 917f503fa..23717fd7f 100644 --- a/nx-X11/lib/X11/XlibInt.c +++ b/nx-X11/lib/X11/XlibInt.c @@ -2673,6 +2673,7 @@ XAddConnectionWatch( UnlockDisplay(dpy); return 0; } + info_list->watch_data = wd_array; wd_array[dpy->watcher_count] = NULL; /* for cleanliness */ } -- cgit v1.2.3