-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/osutil: Prevent infinite Glob recursion (fixes #3577) #3665
Conversation
@st-jenkins add to white list |
Awesome. Could you add a test for this also, that runs on windows only? |
Added test for Windows that will panic on unfixed code. |
You should check the runtime.GOOS or add +build windows to the header, as this will most likely consistently fail on non-Windows |
Oh test ignore the |
I actually didn't notice that and I don't know, interesting question. |
I got the same question when writing the test too, so I took a look at how they write the platform specific test in Go src, and edit: I see they had a build flag at top too, I will add it for safe then. |
This prevent filepath.Split(pattern) from returning the same `dir` value as `pattern` which cause infinite recursion on bad input.
In which was I withdraw my comment. |
(BTW, the |
The fmt fail is on |
Ah? Ignore me in that case. |
@st-jenkins retest this please |
@tpng Thanks, gofmt fixed (my bad), test confirmed to run on Windows and fails without the patch! Now just to get Jenkins to play ball... |
@st-jenkins retest this please |
@st-review merge it lib/osutil: Prevent infinite Glob recursion (fixes #3577) Skip-check: authors |
(there is nothing wrong with the authorship, it's just Jenkins has some issues atm) |
👍 thanks @tpng! |
This prevents filepath.Split(pattern) from returning the same
dir
value aspattern
which cause infinite recursion on bad input.Testing
In GUI, click "Add folder".
In folder path type: \?\C:\Users