fix(ops): address provenance gate review findings
Co-authored-by: genichin <4282227+genichin@users.noreply.github.com>
This commit is contained in:
committed by
Hermes Agent
co-authored by
genichin
parent
8d9d627b1c
commit
619feff5f4
@@ -98,9 +98,10 @@ def _sha256_bytes(payload: bytes) -> str:
|
||||
|
||||
|
||||
def _resolve_under(root: Path, relpath: str) -> Path | None:
|
||||
candidate = (root / relpath).resolve()
|
||||
resolved_root = root.resolve()
|
||||
candidate = (resolved_root / relpath).resolve()
|
||||
try:
|
||||
candidate.relative_to(root)
|
||||
candidate.relative_to(resolved_root)
|
||||
return candidate
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user