From b28adb6a62661b60f80c7c1b6237b74fb7cdcee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 9 Mar 2017 15:09:44 +0200 Subject: Fix an error introduced in the previous commit. fil_parse_write_crypt_data(): Correct the comparison operator. This was broken in commit 498f4a825b29a37cb27f1c76741987de8c510d06 which removed a signed/unsigned mismatch in these comparisons. --- storage/innobase/fil/fil0crypt.cc | 4 ++-- storage/xtradb/fil/fil0crypt.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index 128a0dba312..f19b29d347b 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -473,7 +473,7 @@ fil_parse_write_crypt_data( 4 + // size of key_id 1; // fil_encryption_t - if (ptr + entry_size < end_ptr) { + if (ptr + entry_size > end_ptr) { return NULL; } @@ -499,7 +499,7 @@ fil_parse_write_crypt_data( fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr); ptr +=1; - if (ptr + len < end_ptr) { + if (ptr + len > end_ptr) { return NULL; } diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index 31eb913c650..eaa7da4f144 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -473,7 +473,7 @@ fil_parse_write_crypt_data( 4 + // size of key_id 1; // fil_encryption_t - if (ptr + entry_size < end_ptr) { + if (ptr + entry_size > end_ptr) { return NULL; } @@ -499,7 +499,7 @@ fil_parse_write_crypt_data( fil_encryption_t encryption = (fil_encryption_t)mach_read_from_1(ptr); ptr +=1; - if (ptr + len < end_ptr) { + if (ptr + len > end_ptr) { return NULL; } -- cgit v1.2.1