This commit is contained in:
Kovid Goyal 2021-08-22 13:13:13 +05:30
parent 42dcecde14
commit b282464604
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -117,7 +117,7 @@ def __call__(self, data: bytes, is_last: bool = False) -> bytes:
def resolve_name(name: str, base: str) -> Optional[str]:
if name.startswith('/'):
if name.startswith('/') or os.path.isabs(name):
return None
base = os.path.abspath(base)
q = os.path.abspath(os.path.join(base, name))