aboutsummaryrefslogtreecommitdiff
path: root/xcursor/xcursor.c
diff options
context:
space:
mode:
authorAntonin Décimo <antonin.decimo@gmail.com>2022-03-13 20:50:03 +0100
committerSimon Ser <contact@emersion.fr>2022-05-02 15:15:24 +0200
commit95d3529edf16add98d0f2f7c749b59d2d861bfa4 (patch)
treebf1f424d9d7d07debc5461a399ca764826da6a45 /xcursor/xcursor.c
parent48c811ffb6ef49a311eb25669da96519bfd5dc97 (diff)
xcursor: check that XDG base directory path is absolute
The spec reads: > All paths set in these environment variables must be absolute. If an > implementation encounters a relative path in any of these variables it should > consider the path invalid and ignore it. and > If $XDG_DATA_HOME is either not set or empty, a default equal to > $HOME/.local/share should be used. Testing that the path is absolute also entails that is is non-empty.
Diffstat (limited to 'xcursor/xcursor.c')
-rw-r--r--xcursor/xcursor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c
index b0c424f4..d9a942f8 100644
--- a/xcursor/xcursor.c
+++ b/xcursor/xcursor.c
@@ -647,7 +647,7 @@ XcursorLibraryPath (void)
}
else {
env_var = getenv("XDG_DATA_HOME");
- if (env_var) {
+ if (env_var && env_var[0] == '/') {
pathlen = strlen(env_var) +
strlen(CURSORDIR ":" XCURSORPATH) + 1;
path = malloc(pathlen);