[MDEV-24031] Aria storage engine uses sizeof(ft_boolean_syntax) as a replacement for strlen() but "ft_boolean_syntax" has "const char *" type. Created: 2020-10-26 Updated: 2020-12-23 Resolved: 2020-12-23 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Aria |
| Affects Version/s: | 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6 |
| Fix Version/s: | 10.6.0 |
| Type: | Bug | Priority: | Trivial |
| Reporter: | Rinat Ibragimov (Inactive) | Assignee: | Robert Bindar |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | beginner-friendly | ||
| Description |
|
Code in maria_ft_boolean_check_syntax_string() uses sizeof(ft_boolean_syntax), most probably to compute its length. It made sense at the time that code was written, since ft_boolean_syntax had char[15] type. Then at some point type of ft_boolean_syntax was changed to const char *, but maria_ft_boolean_check_syntax_string() still uses sizeof(ft_boolean_syntax). The issue is trivial, since maria_ft_boolean_check_syntax_string() function is not used anywhere. |
| Comments |
| Comment by Robert Bindar [ 2020-12-15 ] |
|
Hi rinat.ibragimov, there is a PR opened that fixes this issue. Do you mind sharing how you got to see this problem? Did the compiler issue a warning? |
| Comment by Rinat Ibragimov (Inactive) [ 2020-12-15 ] |
|
I was working on a n-gram full-text parser plugin, and during debugging phase visually inspected code parts related to full-text search. So merely by chance. |
| Comment by Robert Bindar [ 2020-12-22 ] |
|
Hehe, changes were in your favour then, thanks for sharing the story rinat.ibragimov |
| Comment by Robert Bindar [ 2020-12-23 ] |
|
Pull Request merged, thanks rinat.ibragimov for the help on this! |