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 m_requestHostName variable behavior #3298

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

airween
Copy link
Member

@airween airween commented Nov 12, 2024

what

This PR fixes the wrong behavior of m_requestHostName transaction variable.

why

Previously, this variable was set when the setRequestHostName() was called, but previously it was initialized in processConnection(). So the last function overwritten the variable, and the previously set value disappeared.

If the connector calls if after processConnection(), then the host field in log entries which generated during processConnection() phase does not contain the necessary value.

The solution was to add a condition which sets the m_requestHostName only if it's empty. Also the correct call to the function setRequestHostName() can be seen in the regression.cc.

This modification does not modify the API.

Copy link

sonarcloud bot commented Nov 12, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
E Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@airween
Copy link
Member Author

airween commented Nov 19, 2024

No other notes, going to merge this.

@airween airween merged commit 41fd21b into owasp-modsecurity:v3/master Nov 19, 2024
48 of 49 checks passed
@marcstern marcstern added the 3.x Related to ModSecurity version 3.x label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants