Find a file
Mikhail Dmitrichenko f83807647e 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>
2025-12-19 03:32:35 +00:00
.gitlab-ci ci: Install XCB dependencies for meson tests 2025-02-26 09:57:07 +01:00
composite composite: Only copy bits from the parent pixmap when absolutely necessary 2025-10-13 11:58:35 +03:00
config Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
damageext Revert "os: unexport SetCriticalOutputPending()" 2025-06-24 11:23:14 -07:00
dbe Revert "os: move out extension disable flags to corresponing extensions" 2025-06-17 20:54:49 +00:00
dix dix: set errorValue correctly when XID lookup fails in ChangeGCXIDs() 2025-12-08 05:52:19 +00:00
doc Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
dri3 dri: prevent out-of-bounds read in dri3_fd_from_pixmap 2025-11-01 21:55:42 +00:00
exa Revert "exa: use dixDestroyPixmap() instead of direct driver call" 2025-06-17 20:02:16 +00:00
fb Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
glamor glamor: fix Option "GlxVendorLibrary" 2025-11-27 10:28:03 +00:00
glx glx: Don't blindly write 8 bytes in GLX single replies 2025-07-02 13:00:47 -04:00
hw xwayland: Fix incorrect pointer coordinates in enter events 2025-12-16 10:51:34 +08:00
include Revert "dix: unexport dixLookupProperty()" 2025-11-17 21:33:26 +01:00
man man pages: strip trailing whitespace 2025-05-31 14:51:24 -07:00
mi Revert "dix: unexport CheckCursorConfinement()" 2025-09-06 17:01:38 +00:00
miext Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
os os: avoid closing null fd at Fopen 2025-12-19 03:32:35 +00:00
present present: Fix use-after-free in present_create_notifies() 2025-10-28 13:22:43 +01:00
pseudoramiX pseudoramiX: drop swapping request length fields 2025-02-06 22:28:49 +00:00
randr Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
record Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
render Revert "dix: unexport cursor refcounting functions" 2025-09-06 17:01:39 +00:00
test Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
Xext Revert "dix: unexport dixLookupProperty()" 2025-11-17 21:33:26 +01:00
xfixes Revert "dix: unexport cursor refcounting functions" 2025-09-06 17:01:39 +00:00
Xi Xi: handle allocation failure in add_master_func() 2025-10-07 23:35:38 +00:00
xkb xkb: Prevent overflow in XkbSetCompatMap() 2025-10-28 13:22:43 +01:00
.appveyor.yml appveyor: Add libxcvt build dep 2021-11-04 13:03:25 +00:00
.dir-locals.el .dir-locals.el: Add missing final newline 2019-10-01 17:05:28 +00:00
.git-blame-ignore-revs Ignore the coding style change commit during git blame 2024-12-06 09:55:53 +10:00
.gitignore Clean up the .gitignore file 2024-01-12 00:50:24 +00:00
.gitlab-ci.yml ci: run builds with most options enabled and most options disabled 2025-08-30 10:01:32 -07:00
.mailmap Update mailmap for Peter Harris 2025-04-15 13:49:13 -04:00
.travis.yml travis: Add OSX meson build to matrix 2019-05-02 15:42:58 +00:00
COPYING os: Use EVP APIs when building with OpenSSL 3 2025-09-29 17:35:28 +00:00
meson.build meson.build: include Xephyr in output of which ddx we're building 2025-08-31 12:43:56 -07:00
meson_options.txt os: drop SUN-DES-1 authentication 2024-06-18 00:52:11 +00:00
README.md Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
SECURITY.md Create a SECURITY.md file 2025-11-18 17:08:42 -08:00
xorg-server.m4 Strip trailing whitespace from source files 2025-10-05 11:56:48 -07:00
xorg-server.pc.in pkgconfig files: Add URL 2025-03-09 07:32:28 +00:00
xserver.ent.in doc: relocate xserver.ent in the package root directory 2011-05-14 11:22:26 -07:00

X Server

The X server accepts requests from client applications to create windows, which are (normally rectangular) "virtual screens" that the client program can draw into.

Windows are then composed on the actual screen by the X server (or by a separate composite manager) as directed by the window manager, which usually communicates with the user via graphical controls such as buttons and draggable titlebars and borders.

For a comprehensive overview of X Server and X Window System, consult the following article: https://en.wikipedia.org/wiki/X_server

All questions regarding this software should be directed at the Xorg mailing list:

https://lists.freedesktop.org/mailman/listinfo/xorg

The primary development code repository can be found at:

https://gitlab.freedesktop.org/xorg/xserver

For patch submission instructions, see:

https://www.x.org/wiki/Development/Documentation/SubmittingPatches

As with other projects hosted on freedesktop.org, X.Org follows its Code of Conduct, based on the Contributor Covenant. Please conduct yourself in a respectful and civilized manner when using the above mailing lists, bug trackers, etc:

https://www.freedesktop.org/wiki/CodeOfConduct