forked from enlightenment/efl
check for invalid protocol values before accessing the array
SVN revision: 11310
This commit is contained in:
parent
108be9ed1c
commit
288a11f6a9
|
@ -473,6 +473,10 @@ ecore_x_window_prop_protocol_set(Ecore_X_Window win,
|
||||||
int already_set = 0;
|
int already_set = 0;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* check for invalid values */
|
||||||
|
if (protocol < 0 || protocol >= ECORE_X_WM_PROTOCOL_NUM)
|
||||||
|
return;
|
||||||
|
|
||||||
proto = _ecore_x_atoms_wm_protocols[protocol];
|
proto = _ecore_x_atoms_wm_protocols[protocol];
|
||||||
|
|
||||||
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
|
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
|
||||||
|
@ -539,6 +543,10 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
|
||||||
Atom proto, *protos = NULL;
|
Atom proto, *protos = NULL;
|
||||||
int i, ret = 0, protos_count = 0;
|
int i, ret = 0, protos_count = 0;
|
||||||
|
|
||||||
|
/* check for invalid values */
|
||||||
|
if (protocol < 0 || protocol >= ECORE_X_WM_PROTOCOL_NUM)
|
||||||
|
return 0;
|
||||||
|
|
||||||
proto = _ecore_x_atoms_wm_protocols[protocol];
|
proto = _ecore_x_atoms_wm_protocols[protocol];
|
||||||
|
|
||||||
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
|
if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
|
||||||
|
|
Loading…
Reference in New Issue