Skip to content
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

Go: fix flow through string concatenation in go/incomplete-hostname-regexp #16307

Merged
merged 6 commits into from
Apr 25, 2024

Conversation

owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Apr 23, 2024

The source definition (which dates back to the first commit for the codeql-go repo) was trying to avoid duplicated results, but in a way that didn't work. The problem was that we don't make expression nodes for the operands of an expression like "a" + "b" when we have a constant value for the whole expression. This PR changes how we avoid duplicate results so that it shouldn't miss any sources. It also adds flow through string concatenation and some extra tests.

@github-actions github-actions bot added the Go label Apr 23, 2024
@owen-mc owen-mc force-pushed the go/fix/incomplete-hostname-regex branch from b56b1f9 to c61177c Compare April 24, 2024 13:22
@owen-mc owen-mc marked this pull request as ready for review April 24, 2024 13:41
@owen-mc owen-mc requested a review from a team as a code owner April 24, 2024 13:41
@owen-mc
Copy link
Contributor Author

owen-mc commented Apr 24, 2024

MRVA didn't show any extra results on the top 1000 go repos. I did find an extra result on the repo which prompted this investigation (which was prompted by the investigation of two extra results for Go: extractor: do not store intermediate values in long string concatenations).

@owen-mc
Copy link
Contributor Author

owen-mc commented Apr 24, 2024

DCA (for just this query) showed no alert changes and no significant change in analysis time.

@owen-mc owen-mc merged commit 82bbecc into github:main Apr 25, 2024
15 checks passed
@owen-mc owen-mc deleted the go/fix/incomplete-hostname-regex branch April 25, 2024 08:43
@owen-mc owen-mc changed the title Go: fix flow through string concatenation in go/incomplete-hostname-regex Go: fix flow through string concatenation in go/incomplete-hostname-regexp May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants