diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-04-07 14:13:21 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2024-04-07 14:13:21 -0400 |
commit | d1f14c7b46ceb550c5cc6e60305ab2b8a50e95bd (patch) | |
tree | 290837fa33a5d0f8cc92de75679cff42cc3e00d0 /firmware/target | |
parent | 4e1faa032f31783880fefb81805ad40c0fc30c2e (diff) | |
download | rockbox-d1f14c7b46ceb550c5cc6e60305ab2b8a50e95bd.tar.gz rockbox-d1f14c7b46ceb550c5cc6e60305ab2b8a50e95bd.zip |
[BugFix] Hosted incoming directory component leading slashes
leading slashes in directory components to path_append
makes a path with a leading slash absolute and discards
the basepath
Change-Id: I65253080c0ca4278b559894104ab25ab199a3100
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/hosted/filesystem-app.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/firmware/target/hosted/filesystem-app.c b/firmware/target/hosted/filesystem-app.c index b36f04a0fe..5b291154fa 100644 --- a/firmware/target/hosted/filesystem-app.c +++ b/firmware/target/hosted/filesystem-app.c | |||
@@ -210,7 +210,7 @@ const char * handle_special_dirs(const char *dir, unsigned flags, | |||
210 | if (!strncmp(HOME_DIR, dir, HOME_DIR_LEN)) | 210 | if (!strncmp(HOME_DIR, dir, HOME_DIR_LEN)) |
211 | { | 211 | { |
212 | const char *p = dir + HOME_DIR_LEN; | 212 | const char *p = dir + HOME_DIR_LEN; |
213 | while (*p == '/') p++; | 213 | while (*p == PATH_SEPCH) p++; /* strip leading slashes */ |
214 | path_append(buf, rbhome, p, bufsize); | 214 | path_append(buf, rbhome, p, bufsize); |
215 | dir = buf; | 215 | dir = buf; |
216 | } | 216 | } |
@@ -232,6 +232,7 @@ const char * handle_special_dirs(const char *dir, unsigned flags, | |||
232 | #endif | 232 | #endif |
233 | ) | 233 | ) |
234 | { | 234 | { |
235 | while (*dir == PATH_SEPCH) dir++; /* strip leading slashes */ | ||
235 | path_append(buf, PIVOT_ROOT, dir, bufsize); | 236 | path_append(buf, PIVOT_ROOT, dir, bufsize); |
236 | dir = buf; | 237 | dir = buf; |
237 | } | 238 | } |