Skip to content

Conversation

@pshao25
Copy link
Member

@pshao25 pshao25 commented Oct 11, 2025

for (let i = 0; i < wrapped.length; i++) {
if (wrapped[i].includes("@") || wrapped[i].includes("*/")) {
if (wrapped[i].includes("@")) {
wrapped[i] = wrapped[i].replace(/@/g, "\\@");

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This does not escape backslash characters in the input.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handled in L20

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that is what the codeql is warning you about. I think it tells you that you won't escape this correctly

\@

becomes

\\@

but I think for how doc comments are parsed its a false positive.

you might also be able to replace to .replaceAll("@", "\\@") instead of using regex and it might not flag

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.

Generate doc comments instead of @doc

3 participants