Bug #89422 | Dangerous enum-ulong casts in sql_formatter_options | ||
---|---|---|---|
Submitted: | 25 Jan 2018 16:56 | Modified: | 26 Jan 2018 16:14 |
Reporter: | Zsolt Parragi (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: mysqldump Command-line Client | Severity: | S3 (Non-critical) |
Version: | 5.7 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[25 Jan 2018 16:56]
Zsolt Parragi
[26 Jan 2018 14:04]
MySQL Verification Team
Hi! That particular field that you mentioned in the end is in the Sql_formatter_options class and not in Sql_formatter class, as you state. Otherwise your analysis is quite correct. It should be mentioned that 32 builds will be discontinued in the future, so I truly do not know what will be the final priority of this bug. Verified.
[26 Jan 2018 16:14]
Zsolt Parragi
While this bug in its current form only could cause issues for 32 bit builds, it is a possible bug source in 64 bit builds too, if somebody changes the code: For example imagine that somebody adds a data member between the two variables I mentioned, an int, short, or anything which requires at most 4 byte alignment. In this case, the new variable will occupy the currently unused memory space, and will cause bugs which will be quite hard to debug.
[13 Feb 2018 10:50]
Zsolt Parragi
Changing the enum to an ulong (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: enum-ulong.diff (text/x-patch), 2.14 KiB.