Skip to content

fs: fix realpath inode link caching

The fs.realpath / fs.realpathSync cache already seen symbolic links using the inode number which may be longer that max supported JS number (2**53) and will therefore be incorrectly handled by possibly entering infinite loop of calling stat on the same node.

This PR changes those functions (where appropriate) to use bigint for inode numbers.

Fixes: https://github.com/nodejs/node/issues/33936

I don't think it is possible to write a test for this as it depends on specific inode numbers being bigger than 2**53.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

/cc @nodejs/fs @bnoordhuis

Merge request reports

Loading