Files
Mikhail Dmitrichenko 9036215b02 dix: avoid null ptr deref at doListFontsAndAliases
In the `doListFontsAndAliases` function in dixfonts.c, when a font alias
is encountered (`err == FontNameAlias`) as a result of
`list_next_font_or_alias` call, the code allocates memory for
`resolved` variable (`resolvedlen + 1` bytes) for storing target font
name. In this case, if the `malloc(resolvedlen + 1)` call fails,
`resolved` remains NULL.

Later, when check (`else if (err == FontNameAlias)`) is TRUE, the code
uses `memcpy` to copy nullable `resolved` into `tmp_pattern` without
checking if `resolved` is NULL, so there is a potential null ptr
dereference.

This commit replaces `malloc` with `XNFalloc` for allocating memory for
`resolved`. `XNFalloc` will internally check result of `malloc` and stop
program execution if allocation was failed, preventing potential NULL
dereferencing.

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/2114>
2026-03-16 13:26:38 +01:00
..
2020-07-05 13:07:33 -07:00
2003-11-14 15:54:54 +00:00
2025-11-11 10:46:29 +01:00
2026-01-31 16:16:19 +01:00
2025-02-11 19:13:01 +01:00
2025-11-20 17:42:29 +01:00
2025-11-11 10:46:29 +01:00
2026-03-16 13:11:07 +01:00
2025-12-19 12:01:03 +01:00
2025-07-18 22:24:55 +02:00
2026-03-16 13:11:07 +01:00
2025-11-20 19:22:35 +01:00
2025-12-19 11:58:53 +01:00
2024-03-05 16:57:52 +01:00
2026-03-16 13:11:07 +01:00
2025-11-25 18:26:02 +01:00
2013-07-23 23:56:58 +01:00
2026-01-31 16:20:28 +01:00
2026-01-31 16:16:19 +01:00
2026-01-31 16:20:28 +01:00