Skip to content

Commit fc983f6

Browse files
committed
f Better handling of relative_path
1 parent 4e6be03 commit fc983f6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lightning-persister/src/fs_store.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,11 @@ impl KVStore for FilesystemStore {
259259
}
260260
}
261261

262-
if let Ok(relative_path) = p.strip_prefix(&prefixed_dest) {
263-
keys.push(relative_path.display().to_string())
262+
if let Some(relative_path) = p.strip_prefix(&prefixed_dest).ok()
263+
.and_then(|p| p.to_str()) {
264+
if relative_path.chars().all(|c| c.is_ascii() && !c.is_control()) {
265+
keys.push(relative_path.to_string())
266+
}
264267
}
265268
}
266269

0 commit comments

Comments
 (0)