xserver/randr
Enrico Weigelt, metux IT consult e9e11a595e (!1972) randr: add BUG_* checks for possible NULL pointer issue
The ‘RRCrtcNotify() and RRCrtcSet() functions are exported, so there's chance
that a buggy driver could call them with NULL parameter, leading to segfault.
Those are hard to trace, so it's better having a BUG_* check here.

| ../randr/rrcrtc.c: In function ‘RRCrtcNotify’:
| ../randr/rrcrtc.c:187:5: warning: use of NULL ‘outputs’ where non-null expected [CWE-476] [-Wanalyzer-null-argument]
|   187 |     memcpy(crtc->outputs, outputs, numOutputs * sizeof(RROutputPtr));
|       |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

| ../randr/rrcrtc.c: In function ‘RRCrtcSet’:
| ../randr/rrcrtc.c:742:20: warning: dereference of NULL ‘outputs’ [CWE-476] [-Wanalyzer-null-dereference]
|   742 |         if (outputs[o]) {
|       |             ~~~~~~~^~~

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-03 11:37:31 +02:00
..
meson.build meson: hide C API if Xorg is disabled (like autotools) 2021-03-11 00:22:36 +00:00
randr.c (!1985) randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-03 11:37:30 +02:00
randrstr.h (!1985) randr: unexport and document RRXineramaExtensionInit() 2025-06-03 11:37:31 +02:00
randrstr_priv.h (!1985) randr: unexport and document RRTransformCopy() 2025-06-03 11:37:31 +02:00
rrcrtc.c (!1972) randr: add BUG_* checks for possible NULL pointer issue 2025-06-03 11:37:31 +02:00
rrdispatch.c (!1985) randr: unexport screen related request handlers 2025-06-03 11:37:30 +02:00
rrdispatch_priv.h (!1985) randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-03 11:37:30 +02:00
rrinfo.c (!1985) randr: unexport and document RROutputSetSubpixelOrder() 2025-06-03 11:37:30 +02:00
rrlease.c (!1985) randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-03 11:37:30 +02:00
rrmode.c (!1985) randr: unexport mode related request handlers 2025-06-03 11:37:30 +02:00
rrmonitor.c (!1985) randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-03 11:37:30 +02:00
rroutput.c (!1972) randr: ProcRRGetOutputInfo() skip payload assembly when nothing to do 2025-06-03 11:37:31 +02:00
rrpointer.c (!1985) randr: unexport and document RRCrtcGetScanoutSize() 2025-06-03 11:37:30 +02:00
rrproperty.c (!1972) randr: refine allocation and copying of optional buffers 2025-06-03 11:37:31 +02:00
rrprovider.c (!1985) randr: unexport provider related request handlers 2025-06-03 11:37:30 +02:00
rrproviderproperty.c (!1972) randr: simplify reply assembly in ProcRRListProviderProperties() 2025-06-03 11:37:31 +02:00
rrscreen.c (!1972) randr: skip payload assembly in ProcRRGetScreenInfo() no data to send 2025-06-03 11:37:31 +02:00
rrsdispatch.c (!1985) randr: unexport screen related request handlers 2025-06-03 11:37:30 +02:00
rrtransform.c (!1985) randr: unexport and document RRTransformInit() 2025-06-03 11:37:31 +02:00
rrtransform.h (!1985) randr: unexport and document RRTransformCopy() 2025-06-03 11:37:31 +02:00
rrxinerama.c randr: use struct initializer for reply structs 2025-02-24 20:30:26 +00:00