| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
…ar handling Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the @coderabbitai review command. You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file. Comment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
@copilot ты не прав. \0 в двойных кавычках же вообще не удаляет null-String, а только бэкслэш с нулем. В отличие от одинарных кавычек |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR addresses feedback from PR #1649 by refactoring the null character handling in PathHelper.cs to be more targeted and secure. The change improves the implementation from removing all null characters to removing only trailing null characters.
Changes:
Sorry, something went wrong.
В C# "\0" в строковом литерале — это escape sequence, который представляет null-символ (как и '\0'). Проверил на тесте: string s = "hello\0world";
Console.WriteLine(s.Replace("\0", "").Length); // 10 (было 11)Replace("\0", "") действительно удалял null-символы. Но замена на TrimEnd('\0') правильная по другой причине — нужно удалять только trailing nulls, чтобы не маскировать потенциальные атаки типа file.txt\0.exe. |
Sorry, something went wrong.
|
@copilot ты опять закоммитил мусор |
Sorry, something went wrong.
Co-authored-by: nixel2007 <1132840+nixel2007@users.noreply.github.com>
|
Sorry, something went wrong.
По-моему, все-таки удаляет. Или я чего-то не знаю. @nixel2007 откуда инфа, что не удаляет? |
Sorry, something went wrong.
|
@EvilBeaver я спутал, копилот и ты правы |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Fixed the issue raised by @Mr-Rm in PR #1649 comments:
Before: path.Replace("\0", "") - removed ALL null characters from path
After: path.TrimEnd('\0') - removes only TRAILING null characters
This is safer because:
- Windows WebDAV client adds null chars at the END of paths (trailing)
- TrimEnd is more targeted - only fixes the actual issue
- Replace could mask security issues like "file.txt\0.exe" where null char hides true extension
Original prompt💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.