dix: touch: NULL-protection in TouchAddRegularListener()
protect against the (unlikely) case that inputMasks == NULL. | ../dix/touch.c: In function ‘TouchAddRegularListener’: | ../include/list.h:376:21: warning: dereference of NULL ‘0’ [CWE-476] [-Wanalyzer-null-dereference] | 376 | for (_entry = _list; _entry; _entry = (_entry)->_member) | ../dix/touch.c:766:9: note: in expansion of macro ‘nt_list_for_each_entry’ | 766 | nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { | | ^~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
076bc54064
commit
654c9c1f3d
|
@ -760,7 +760,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
|
||||
inputMasks = wOtherInputMasks(win);
|
||||
|
||||
if (mask & EVENT_XI2_MASK) {
|
||||
if ((mask & EVENT_XI2_MASK) && (inputMasks != NULL)) {
|
||||
nt_list_for_each_entry(iclients, inputMasks->inputClients, next) {
|
||||
if (!xi2mask_isset(iclients->xi2mask, dev, evtype))
|
||||
continue;
|
||||
|
@ -774,7 +774,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
|
|||
}
|
||||
}
|
||||
|
||||
if (mask & EVENT_XI1_MASK) {
|
||||
if ((mask & EVENT_XI1_MASK) && (inputMasks != NULL)) {
|
||||
int xitype = GetXIType(TouchGetPointerEventType(ev));
|
||||
Mask xi_filter = event_get_filter_from_type(dev, xitype);
|
||||
|
||||
|
|
Loading…
Reference in New Issue