]> Cypherpunks repositories - gostls13.git/commit
os: prevent infinite symlink loop of Stat on Windows
authorHiroshi Ioka <hirochachacha@gmail.com>
Thu, 18 Aug 2016 07:10:28 +0000 (16:10 +0900)
committerAlex Brainman <alex.brainman@gmail.com>
Fri, 26 Aug 2016 05:58:01 +0000 (05:58 +0000)
commit2eb46e8c57c4dab0197ca82d9899fa1356500fc0
treed6b677fc60ae8235121b6b3c2e09fee1ee2c2160
parent5a6f973565ccb54c77e03cbb4844fd0ea392d3fe
os: prevent infinite symlink loop of Stat on Windows

The Windows version of Stat calls Readlink iteratively until
reaching a non-symlink file.
If the given file is a circular symlink, It never stops.
This CL defines the maximum number of symlink loop count.
If the loop count will exceed that number, Stat will return error.

Fixes #16538

Change-Id: Ia9f3f2259a8d32801461c5041cc24a34f9f81009
Reviewed-on: https://go-review.googlesource.com/27580
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/os/os_test.go
src/os/stat_windows.go