Severity: medium
Type: robustness
Location: clipsync/clipboard.py — ClipboardSync._write_file() (~line 710), _write_image_file() (~line 790)
Problem: Both methods write to a .tmp sibling and then tmp.replace(path). If the replace fails with a non-PermissionError, or after the retry loop exhausts, the exception propagates and the temporary file is left behind. Syncthing may then sync the partial .tmp file to peers.
Suggested fix: Wrap the replace loop in a try/finally (or context manager) that deletes the temporary file whenever the write does not complete successfully.
Filed from a full-source audit of the repo (2026-07-29). Reported by the audit but not independently confirmed - verify the cited code before acting on it.
Severity: medium
Type: robustness
Location:
clipsync/clipboard.py—ClipboardSync._write_file()(~line 710),_write_image_file()(~line 790)Problem: Both methods write to a
.tmpsibling and thentmp.replace(path). If the replace fails with a non-PermissionError, or after the retry loop exhausts, the exception propagates and the temporary file is left behind. Syncthing may then sync the partial.tmpfile to peers.Suggested fix: Wrap the replace loop in a
try/finally(or context manager) that deletes the temporary file whenever the write does not complete successfully.Filed from a full-source audit of the repo (2026-07-29). Reported by the audit but not independently confirmed - verify the cited code before acting on it.