From 9abd6f741b6a4d5ec5fc65cce7ecd16e7d4c5c72 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 --- src/library.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/library.c b/src/library.c index fd040ce..ba66ca5 100644 --- a/src/library.c +++ b/src/library.c @@ -259,8 +259,10 @@ 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); + for (i = inherits; i && f == NULL; i = _XcursorNextPath (i)) { + 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; -- 2.10.2