Skip to content

Fix code scanning alert no. 10: Incomplete string escaping or encoding #2

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

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

guruh46
Copy link
Owner

@guruh46 guruh46 commented Nov 27, 2024

Fixes https://github.com/guruh46/vscode-gitlens/security/code-scanning/10

To fix the problem, we need to ensure that backslashes are properly escaped in the input string. This can be achieved by adding an additional replace call to escape backslashes before escaping other characters. Specifically, we should replace backslashes with double backslashes before replacing parentheses.

The best way to fix the problem without changing existing functionality is to modify the createMarkdownCommandLink function to include an additional replace call for backslashes. This change should be made in the file src/system/commands.ts on lines 13-16.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@guruh46 guruh46 marked this pull request as ready for review November 27, 2024 11:32
@guruh46 guruh46 merged commit 60a3be6 into main Nov 27, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant