Skip to content

Enable compiler sanitizers for test builds, fixed new bugs found with them#1154

Merged
gittiver merged 5 commits intoCrowCpp:masterfrom
shan-tanu-joshi-3010:fix-query-string-oob
Mar 8, 2026
Merged

Enable compiler sanitizers for test builds, fixed new bugs found with them#1154
gittiver merged 5 commits intoCrowCpp:masterfrom
shan-tanu-joshi-3010:fix-query-string-oob

Conversation

@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor

No description provided.

@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor Author

tried to add the feature sanitizer in cli issue #1137

@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor Author

the feature has two sanitizers AddressSanitizer (ASan) and UndefinedBehaviorSanitizer (UBSan) and works only for ci not for production

@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor Author

fixes the error

Comment thread CMakePresets.json
Copy link
Copy Markdown
Member

@gittiver gittiver left a comment

Choose a reason for hiding this comment

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

There are changes in query_string and tests which are not directly related to sanitizers.
Why are they there - warnings by sanitizers and can we have these fixes separately?

@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor Author

There are changes in query_string and tests which are not directly related to sanitizers. Why are they there - warnings by sanitizers and can we have these fixes separately?

These changes are directly caused by the sanitizer build configuration. The ci-sanitize preset inherits from ci-linux, which uses the flags-gcc-clang compiler flags — including -Wold-style-cast, -Wconversion, and -Wsign-conversion with -Werror. The
query_string.h changes replace C-style casts with static_cast and add bounds-checking to prevent heap-buffer-overflow (the original issue this PR addresses). The test changes fix corresponding warnings so the sanitizer build compiles cleanly.
These aren't cosmetic cleanups — they're required for the sanitizer build to pass. I can split them into a separate PR if you prefer, but note that the sanitizer CI job will fail without them.

@shan-tanu-joshi-3010
Copy link
Copy Markdown
Contributor Author

If you want I can solve this in a seperate pr but I am new to git hub so I am still figuring out how things work here

@gittiver gittiver linked an issue Mar 8, 2026 that may be closed by this pull request
@gittiver gittiver changed the title Enable compiler sanitizers for test builds Enable compiler sanitizers for test builds, fixed new bugs found Mar 8, 2026
@gittiver gittiver changed the title Enable compiler sanitizers for test builds, fixed new bugs found Enable compiler sanitizers for test builds, fixed new bugs found with them Mar 8, 2026
@gittiver gittiver merged commit 06e93cf into CrowCpp:master Mar 8, 2026
20 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.

Enable compiler sanitizers for test builds

2 participants