diff options
author | Tobias Stoeckmann <tobias@stoeckmann.org> | 2021-05-02 16:00:25 +0200 |
---|---|---|
committer | Tobias Stoeckmann <tobias@stoeckmann.org> | 2021-05-02 16:27:38 +0200 |
commit | b47ca9858ee11bdbd08f1e31102116ff51cb6be5 (patch) | |
tree | 0f4a5c0695fafa7b33d1c93b424dec7d3b1b6950 /man/XcursorLibraryLoadImage.man | |
parent | 403bb32d5fb0dbb9e83ec7a5743b2fee75445ea7 (diff) |
Handle more theme loop situations
This is a follow up for commit f64a8cc1a65dcad4294e2988b402a34175019663
resulting from https://bugs.freedesktop.org/show_bug.cgi?id=3603
The current loop detection only works for direct self references but not
for transitive ones. Limiting the inheritance depth fixes this issue as
suggested by Keith Packard.
I avoided the introduction of a recursion function. Instead I modified
XcursorScanTheme to work iterative.
The current recursion code adds the "Inherits=..." line to heap and has
an iteration variable to go through all themes listed in that line per
recursion. This is covered with the newly introduced XcursorInherit
struct with its fields "line" and "theme". Since "theme" points into
"line", only "line" has to be freed eventually.
If a fixed inheritage limit of 32 is reached, the code stops processing
and returns NULL. It also returns NULL if it detects the initial theme
in one of the inheritages to break the loop early on.
Last but not least I removed the printf statement. The only situation in
which libXcursor writes to stdout is when it is explicitly requested.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'man/XcursorLibraryLoadImage.man')
0 files changed, 0 insertions, 0 deletions