Skip to content

create fopen_modsec#3582

Open
kanseiishikawa wants to merge 2 commits into
owasp-modsecurity:v3/masterfrom
kanseiishikawa:create/fopen_s
Open

create fopen_modsec#3582
kanseiishikawa wants to merge 2 commits into
owasp-modsecurity:v3/masterfrom
kanseiishikawa:create/fopen_s

Conversation

@kanseiishikawa

@kanseiishikawa kanseiishikawa commented Jun 22, 2026

Copy link
Copy Markdown

what

Since fopen_s, which is used in win32, is more secure, we defined and implemented it internally so that it can be used in other operating systems as well.
Since fopen_s can have name conflicts, we're creating it as fopen_modsec.

why

SonarCloud Code Analysis has started causing errors with fopen.

'fopen' is deprecated: This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

references

The goal is to resolve this error.
https://github.com/owasp-modsecurity/ModSecurity/pull/3521/changes#diff-2f0c197bfdbe90b112359e18d7980ca2c8535fe1cbd47ce1029c27130812de2aR113

@kanseiishikawa

Copy link
Copy Markdown
Author

"The SonarCloud duplication (66.7%) is a false positive caused by the very small diff size (only 6 lines). Since I don't have permission to modify the SonarCloud config, could a maintainer please check and approve this manually?"

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
7.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

2 participants