Skip to content

Commit

Permalink
Fix an error introduced in the previous commit.
Browse files Browse the repository at this point in the history
fil_parse_write_crypt_data(): Correct the comparison operator.
This was broken in commit 498f4a8
which removed a signed/unsigned mismatch in these comparisons.
  • Loading branch information
dr-m committed Mar 9, 2017
1 parent 498f4a8 commit b28adb6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions storage/innobase/fil/fil0crypt.cc
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions storage/xtradb/fil/fil0crypt.cc
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit b28adb6

Please sign in to comment.