summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorDaniel Black <daniel.black@au.ibm.com>2017-07-02 14:53:23 +1000
committerSergey Vojtovich <svoj@mariadb.org>2017-07-18 10:09:16 +0400
commitc9883b75914d0ba4975aae0fbf8164f026e88559 (patch)
treea026584bb12180a8f19f779d114834c299dacc2c /storage/myisam
parent7d309b5f74982861efdfd069fd0e46c18d0cb7fe (diff)
downloadmariadb-git-c9883b75914d0ba4975aae0fbf8164f026e88559.tar.gz
ma_check/mi_check: maria_repair_parallel initialization for !quick
end_io_call uses uninitialized values from the new_data_cache As such we the buffer 0 and check this before calling end_io_cache on it. Thanks Sergey Vojtovich for the review and for this solution. Found by Coverity (ref 972481).
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/mi_check.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index df97d6035d8..23e54966e2d 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -2676,6 +2676,8 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
*/
DBUG_PRINT("info", ("is quick repair: %d", rep_quick));
bzero((char*)&sort_info,sizeof(sort_info));
+ if (!rep_quick)
+ my_b_clear(&new_data_cache);
/* Initialize pthread structures before goto err. */
mysql_mutex_init(mi_key_mutex_MI_SORT_INFO_mutex,
&sort_info.mutex, MY_MUTEX_INIT_FAST);
@@ -3050,7 +3052,7 @@ err:
already or they were not yet started (if the error happend before
creating the threads).
*/
- if (!rep_quick)
+ if (!rep_quick && my_b_inited(&new_data_cache))
(void) end_io_cache(&new_data_cache);
if (!got_error)
{