Hi Magnus,
I have one suggestion. See it inline.
On 11/26/2010 12:36 PM, Magnus Blåudd wrote:
> #At file:///home/msvensson/mysql/trunk-bugfixing/ based on
> revid:magnus.blaudd@stripped
>
> 3397 Magnus Blåudd 2010-11-26
> Bug#58517 Alignment sensitive code in rpl_mi.cc causes SIGBUS
> - read into temporary variable of correct size before
> assigning to ssl_verify_server_cert
>
> modified:
> sql/rpl_mi.cc
> === modified file 'sql/rpl_mi.cc'
> --- a/sql/rpl_mi.cc 2010-11-25 11:20:16 +0000
> +++ b/sql/rpl_mi.cc 2010-11-26 12:36:10 +0000
> @@ -281,6 +281,7 @@ bool Master_info::read_info(Rpl_info_han
> char *first_non_digit= NULL;
> ulong temp_master_log_pos= 0;
> int temp_ssl= 0;
> + int temp_ssl_verify_server_cert = 0;
>
> DBUG_ENTER("Master_info::read_info");
>
> @@ -337,7 +338,7 @@ bool Master_info::read_info(Rpl_info_han
> */
> if (lines>= LINES_IN_MASTER_INFO_WITH_SSL)
> {
> - if (from->get_info((int *)&temp_ssl, 0) ||
> + if (from->get_info(&temp_ssl, 0) ||
> from->get_info(ssl_ca, sizeof(ssl_ca), 0) ||
> from->get_info(ssl_capath, sizeof(ssl_capath), 0) ||
> from->get_info(ssl_cert, sizeof(ssl_cert), 0) ||
> @@ -352,7 +353,7 @@ bool Master_info::read_info(Rpl_info_han
> */
> if (lines>= LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT)
> {
> - if (from->get_info((int *)&ssl_verify_server_cert, 0))
> + if (from->get_info(&temp_ssl_verify_server_cert, 0))
> DBUG_RETURN(TRUE);
> }
>
> @@ -401,6 +402,7 @@ bool Master_info::read_info(Rpl_info_han
> }
>
> ssl= (my_bool) temp_ssl;
> + ssl_verify_server_cert= (my_bool) temp_ssl_verify_server_cert;
One suggestion:
ssl= (my_bool) temp_ssl;
ssl_verify_server_cert= (my_bool) temp_ssl_verify_server_cert;
Change to
ssl= (my_bool) test(temp_ssl);
ssl_verify_server_cert= (my_bool) test(temp_ssl_verify_server_cert);
See the coding guidelines for the reason (just to play it safe):
http://forge.mysql.com/wiki/MySQL_Internals_Coding_Guidelines
> master_log_pos= (my_off_t) temp_master_log_pos;
> #ifndef HAVE_OPENSSL
> if (ssl)
>
>
>
>
>