mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-16 01:35:36 -04:00
fix: inside_base_dir raises TypeError on a non-string path instead of failing closed (#1619)
This commit is contained in:
@@ -22,6 +22,8 @@ def abs_join(base_dir: str, rel: str) -> str:
|
||||
|
||||
def inside_base_dir(base_dir: str, path: str) -> bool:
|
||||
"""Check if path is inside base directory."""
|
||||
if not isinstance(base_dir, str) or not isinstance(path, str):
|
||||
return False
|
||||
base = os.path.realpath(base_dir)
|
||||
p = os.path.realpath(path)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user