mirror of
https://github.com/affaan-m/ECC.git
synced 2026-08-17 21:15:40 +02:00
ecc memory writes and --body-file reads fail on Windows. sameFileIdentity() compares the dev field of a path-based stat against a handle-based fstat, and libuv 1.49.0 through 1.50.x resolve path-based stat() and lstat() on Windows through GetFileInformationByName, which leaves the volume serial unset while fstat() reports it. The comparison never matches, so the TOCTOU guard rejects every operation. Keep the inode strict and compare dev only when both sides report one. POSIX always reports a non-zero dev, so the original strict behaviour is preserved there. Request the guard's stats as BigInt. On the affected libuv versions dev is 0, which leaves the inode as the only identity signal, and Windows file IDs run past Number.MAX_SAFE_INTEGER where two distinct files can collapse to the same number-valued inode. Fixes #2626