MDEV-37952: Fix crash when setting mroonga_default_tokenizer to NULL#4606
Open
hadeer-r wants to merge 3 commits intoMariaDB:mainfrom
Open
MDEV-37952: Fix crash when setting mroonga_default_tokenizer to NULL#4606hadeer-r wants to merge 3 commits intoMariaDB:mainfrom
hadeer-r wants to merge 3 commits intoMariaDB:mainfrom
Conversation
kou
approved these changes
Feb 2, 2026
storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_disable.test
Outdated
Show resolved
Hide resolved
Setting mroonga_default_tokenizer to NULL caused a server crash because the update function did not handle the NULL value before passing it to strcmp. Handle NULL values by treating them as "off" to allow safe variable reset.
Author
|
I have applied the feedback to use DEFAULT and empty line formatting. |
kou
added a commit
to mroonga/mroonga
that referenced
this pull request
Feb 5, 2026
- This PR fixes a SIGSEGV crash occurring when the system variable mroonga_default_tokenizer is set to NULL. - The crash was caused by passing a NULL pointer to strcmp() in the update function of the mroonga_default_tokenizer variable. **Changes** - Mapped NULL input to "off" behavior. - Included a test case to verify the fix. This is the same fix I submitted to MariaDB here: MariaDB/server#4606 --------- Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
Align with existing mroonga memory management patterns to ensure consistency, rather than relying on the MariaDB framework default behavior.
Author
|
Hi, I have applied the manual allocation changes for new_value in mrn_default_tokenizer_update as discussed, aligning with the memory management pattern used in the previous Mroonga PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a SIGSEGV crash occurring when the system variable mroonga_default_tokenizer is set to NULL. The fix introduces a safety check to handle NULL values gracefully by treating them as an "off" state, preventing invalid memory access during string comparison.
The crash was rooted in the update function for the mroonga_default_tokenizer variable. It lacked a validation step for NULL inputs before passing the value to strcmp().
Key Changes:
Fix: MDEV-37952