Files
xserver/os
Mikhail Dmitrichenko dd2255c309 os: avoid closing null fd at Fopen
In `Fopen` function variable `iop` may store NULL as a result of `fopen`
call. In this case, if later privileges couldn't be restored (`seteuid`
call fails), further `fclose(iop)` call will cause runtime error.

This commit adds check `iop` for NULL before calling `fclose` to prevent
potential NULL pointer dereference.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2115>
(cherry picked from commit f83807647e)
2026-01-25 10:40:03 -08:00
..
2026-01-25 10:39:53 -08:00
2026-01-25 10:39:53 -08:00
2026-01-19 12:47:57 -08:00
2026-01-25 10:40:02 -08:00
2016-07-21 15:04:47 -04:00
2026-01-25 10:40:03 -08:00
2026-01-19 12:32:20 -08:00