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

fix: attr with multiple nulls #30

Merged
merged 1 commit into from
Jun 10, 2024
Merged

Conversation

M4tteoP
Copy link
Member

@M4tteoP M4tteoP commented Jun 10, 2024

@M4tteoP M4tteoP requested a review from fzipi June 10, 2024 17:00
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

length := len(s)
sUpperWithoutNulls := strings.ToUpper(strings.ReplaceAll(s, "\x00", ""))

length := len(sUpperWithoutNulls)
Copy link
Member Author

Choose a reason for hiding this comment

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

length has to be calculated after stripping off the null bytes. Otherwise sUpperWithoutNulls[:2] might then fail as happened in the fuzz test: panic: runtime error: slice bounds out of range [:2] with length 1

Copy link
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

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

Lgtm

@M4tteoP M4tteoP merged commit 278bf01 into corazawaf:master Jun 10, 2024
5 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.

Fuzz tests #516 failed
2 participants