From f64a8cc1a65dcad4294e2988b402a34175019663 Mon Sep 17 00:00:00 2001 From: Philipp Ludwig Date: Sun, 22 Jan 2017 14:21:54 +0100 Subject: [PATCH] Fix crash when encountering cursor themes with circular dependencies. https://bugs.freedesktop.org/show_bug.cgi?id=3603 Signed-off-by: Philipp Ludwig Signed-off-by: Alan Coopersmith --- src/library.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/library.c b/src/library.c index fd040ce..c6062f7 100644 --- a/src/library.c +++ b/src/library.c @@ -260,7 +260,12 @@ XcursorScanTheme (const char *theme, const char *name) * Recurse to scan inherited themes */ for (i = inherits; i && f == NULL; i = _XcursorNextPath (i)) - f = XcursorScanTheme (i, name); + { + if (strcmp(i, theme) != 0) + f = XcursorScanTheme (i, name); + else + printf("Not calling XcursorScanTheme because of circular dependency: %s. %s", i, name); + } if (inherits != NULL) free (inherits); return f;