summaryrefslogtreecommitdiff
path: root/storage/xtradb/fil
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2016-03-13 15:37:47 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2016-03-13 15:37:47 +0200
commita12326458dde270c9df7aeef3684d5c5d8fd4402 (patch)
tree253a7fc43366ee65c9d191b168686da8152e8867 /storage/xtradb/fil
parentf341d94423daa37bf4bee4d9b96ba8e8d93484c6 (diff)
downloadmariadb-git-a12326458dde270c9df7aeef3684d5c5d8fd4402.tar.gz
Add check to avoid NULL-pointer access if encryption information
is not available. Clarify system tablespace page 0 check.
Diffstat (limited to 'storage/xtradb/fil')
-rw-r--r--storage/xtradb/fil/fil0crypt.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc
index 01b3991af24..79a2eca56d5 100644
--- a/storage/xtradb/fil/fil0crypt.cc
+++ b/storage/xtradb/fil/fil0crypt.cc
@@ -662,7 +662,7 @@ fil_space_encrypt(
return src_frame;
}
- ut_ad(crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+ ut_a(crypt_data != NULL && crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
byte* tmp = fil_encrypt_buf(crypt_data, space, offset, lsn, src_frame, zip_size, dst_frame);
@@ -722,7 +722,7 @@ fil_space_decrypt(
}
if (crypt_data == NULL) {
- if (space != 0 && offset != 0 && key_version != 0) {
+ if (!(space == 0 && offset == 0) && key_version != 0) {
/* FIL_PAGE_FILE_FLUSH_LSN field i.e.
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION
should be only defined for the
@@ -740,7 +740,7 @@ fil_space_decrypt(
return false;
}
- ut_ad(crypt_data != NULL && crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
+ ut_a(crypt_data != NULL && crypt_data->encryption != FIL_SPACE_ENCRYPTION_OFF);
/* read space & lsn */
ulint header_len = FIL_PAGE_DATA;