summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>2011-01-31 14:02:12 +0200
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-02-01 23:46:40 -0800
commit2ace8d5c89c8f6d9f42b4068f4b508ca28f0ced1 (patch)
treefb57a97d94dd2e6cd55582360a96e1d769847b01
parent2b16a7e683e355c9746290b2cee2fd0dd2bf342a (diff)
XlibInt: info_list->watch_data was reallocated, but result was discarded
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 <alan.coopersmith@oracle.com> Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/XlibInt.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/XlibInt.c b/src/XlibInt.c
index c385f4cb..873ed8ba 100644
--- a/src/XlibInt.c
+++ b/src/XlibInt.c
@@ -662,6 +662,7 @@ XAddConnectionWatch(
UnlockDisplay(dpy);
return 0;
}
+ info_list->watch_data = wd_array;
wd_array[dpy->watcher_count] = NULL; /* for cleanliness */
}