[Commits] 2a9c0e8: MDEV-10970: Crash while loading mysqldump backup when InnoDB encryption is enabled

Jan Lindström jan.lindstrom at mariadb.com
Mon Oct 24 22:27:06 EEST 2016


revision-id: 2a9c0e8cbb6273f88ee4f72ba46e26d101395deb (mariadb-10.1.18-13-g2a9c0e8)
parent(s): 1bfa37a79c78998e11c79227089864358d05bb4c
author: Jan Lindström
committer: Jan Lindström
timestamp: 2016-10-24 22:25:54 +0300
message:

MDEV-10970: Crash while loading mysqldump backup when InnoDB encryption is enabled

Follow-up: Make sure we do not reference NULL-pointer when space is being
dropped and does not contain any nodes.

---
 storage/innobase/fil/fil0fil.cc | 7 ++++++-
 storage/xtradb/fil/fil0fil.cc   | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index a88cf6e..7a50ccd 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1001,8 +1001,13 @@ fil_mutex_enter_and_prepare_for_io(
 	does not exist, we handle the situation in the function which called
 	this function */
 
-	if (!space || UT_LIST_GET_FIRST(space->chain)->open) {
+	if (!space) {
+		return;
+	}
+
+	fil_node_t*	node = UT_LIST_GET_FIRST(space->chain);
 
+	if (!node || node->open) {
 		return;
 	}
 
diff --git a/storage/xtradb/fil/fil0fil.cc b/storage/xtradb/fil/fil0fil.cc
index 440b95d..803f3a8 100644
--- a/storage/xtradb/fil/fil0fil.cc
+++ b/storage/xtradb/fil/fil0fil.cc
@@ -1002,8 +1002,13 @@ fil_mutex_enter_and_prepare_for_io(
 	/* If the file is already open, no need to do anything; if the space
 	does not exist, we handle the situation in the function which called
 	this function */
+	if (!space) {
+		return;
+	}
+
+	fil_node_t*	node = UT_LIST_GET_FIRST(space->chain);
 
-	if (!space || UT_LIST_GET_FIRST(space->chain)->open) {
+	if (!node || node->open) {
 
 		return;
 	}


More information about the commits mailing list