|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
The following problems have been found by Coverity - static analysis tool.
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
mysql-5.5.31/plugin/semisync/semisync_master.cc:672:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function.
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
mysql-5.5.31/plugin/semisync/semisync_master.cc:661:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function.
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
mysql-5.5.31/plugin/semisync/semisync_master.cc:555:parameter_as_source – Note: This defect has an elevated risk because the source argument is a parameter of the current function.
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
Jakub Dorňák |
7d334d7 |
diff -up mariadb-10.0.21/plugin/semisync/semisync_master.cc.orig mariadb-10.0.21/plugin/semisync/semisync_master.cc
|
|
Jakub Dorňák |
7d334d7 |
--- mariadb-10.0.21/plugin/semisync/semisync_master.cc.orig 2015-08-05 20:11:31.000000000 +0200
|
|
Jakub Dorňák |
7d334d7 |
+++ mariadb-10.0.21/plugin/semisync/semisync_master.cc 2015-08-10 17:22:31.700604043 +0200
|
|
Jakub Dorňák |
6aba9be |
@@ -553,7 +553,8 @@ int ReplSemiSyncMaster::reportReplyBinlo
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
if (need_copy_send_pos)
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
{
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
- strcpy(reply_file_name_, log_file_name);
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ strncpy(reply_file_name_, log_file_name, sizeof(reply_file_name_)-1);
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ reply_file_name_[sizeof(reply_file_name_)-1] = '\0';
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
reply_file_pos_ = log_file_pos;
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
reply_file_name_inited_ = true;
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
Jakub Dorňák |
6aba9be |
@@ -661,7 +662,8 @@ int ReplSemiSyncMaster::commitTrx(const
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
if (cmp <= 0)
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
{
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
/* This thd has a lower position, let's update the minimum info. */
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
- strcpy(wait_file_name_, trx_wait_binlog_name);
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1);
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ wait_file_name_[sizeof(wait_file_name_)-1] = '\0';
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
wait_file_pos_ = trx_wait_binlog_pos;
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
rpl_semi_sync_master_wait_pos_backtraverse++;
|
|
Jakub Dorňák |
6aba9be |
@@ -672,7 +674,8 @@ int ReplSemiSyncMaster::commitTrx(const
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
}
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
else
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
{
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
- strcpy(wait_file_name_, trx_wait_binlog_name);
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ strncpy(wait_file_name_, trx_wait_binlog_name, sizeof(wait_file_name_)-1);
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ wait_file_name_[sizeof(wait_file_name_)-1] = '\0';
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
wait_file_pos_ = trx_wait_binlog_pos;
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
wait_file_name_inited_ = true;
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
mysql-5.5.31/sql/rpl_handler.cc:306:fixed_size_dest – You might overrun the 512 byte fixed-size string "log_info->log_file" by copying "log_file + dirname_length(log_file)" without checking the length. diff -up mysql-5.5.31/sql/rpl_handler.cc.covscan-stroverflow mysql-5.5.31/sql/rpl_handler.cc
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
Jakub Dorňák |
7d334d7 |
diff -up mariadb-10.0.21/sql/rpl_handler.cc.orig mariadb-10.0.21/sql/rpl_handler.cc
|
|
Jakub Dorňák |
7d334d7 |
--- mariadb-10.0.21/sql/rpl_handler.cc.orig 2015-08-05 20:11:31.000000000 +0200
|
|
Jakub Dorňák |
7d334d7 |
+++ mariadb-10.0.21/sql/rpl_handler.cc 2015-08-10 17:28:57.093803582 +0200
|
|
Jakub Dorňák |
7d334d7 |
@@ -261,7 +261,8 @@ int Binlog_storage_delegate::after_flush
|
|
Jakub Dorňák |
7d334d7 |
thd->semisync_info= log_info;
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
}
|
|
Jakub Dorňák |
7d334d7 |
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
- strcpy(log_info->log_file, log_file+dirname_length(log_file));
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ strncpy(log_info->log_file, log_file+dirname_length(log_file), sizeof(log_info->log_file)-1);
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
+ log_info->log_file[sizeof(log_info->log_file)-1] = '\0';
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
log_info->log_pos = log_pos;
|
|
![](https://seccdn.libravatar.org/avatar/3d0a4f295af5f9857ef04c3d8f6e89d5b4154c2463647b61e8e48ed700d065c7?s=16&d=retro) |
af63a8b |
|
|
Jakub Dorňák |
7d334d7 |
FOREACH_OBSERVER(ret, after_flush, false,
|