mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
WINGs: fix possible null pointer dereference in W_RealizeView (Coverity #50060)
As pointed by Coverity, the function makes use of a pointer which may be null, so we have to properly check that to ensure application will not crash. Signed-off-by: Christophe CURIS <christophe.curis@free.fr> Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
committed by
Carlos R. Mafra
parent
0c659c1618
commit
f60f14b7bd
@@ -188,6 +188,12 @@ void W_RealizeView(W_View * view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!view->flags.realized) {
|
if (!view->flags.realized) {
|
||||||
|
|
||||||
|
if (view->parent == NULL) {
|
||||||
|
wwarning("trying to realize widget without parent");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
parentWID = view->parent->window;
|
parentWID = view->parent->window;
|
||||||
view->window = XCreateWindow(dpy, parentWID, view->pos.x, view->pos.y,
|
view->window = XCreateWindow(dpy, parentWID, view->pos.x, view->pos.y,
|
||||||
view->size.width, view->size.height, 0,
|
view->size.width, view->size.height, 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user