mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-05 05:18:03 +02:00
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>
This commit is contained in:
parent
2b16a7e683
commit
2ace8d5c89
1 changed files with 1 additions and 0 deletions
|
|
@ -662,6 +662,7 @@ XAddConnectionWatch(
|
|||
UnlockDisplay(dpy);
|
||||
return 0;
|
||||
}
|
||||
info_list->watch_data = wd_array;
|
||||
wd_array[dpy->watcher_count] = NULL; /* for cleanliness */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue