@@ -120,7 +120,8 @@ log_crypt(byte* buf, ulint size, bool decrypt)
120120
121121for (const byte* const end = buf + size; buf != end;
122122 buf += OS_FILE_LOG_BLOCK_SIZE) {
123- byte dst[OS_FILE_LOG_BLOCK_SIZE - LOG_CRYPT_HDR_SIZE];
123+ uint32_t dst[(OS_FILE_LOG_BLOCK_SIZE - LOG_CRYPT_HDR_SIZE)
124+ / sizeof (uint32_t )];
124125const ulint log_block_no = log_block_get_hdr_no (buf);
125126
126127/* The log block number is not encrypted. */
@@ -130,8 +131,7 @@ log_crypt(byte* buf, ulint size, bool decrypt)
130131#else
131132~(LOG_BLOCK_FLUSH_BIT_MASK >> 24 )
132133#endif
133- & (*reinterpret_cast <uint32_t *>(dst)
134- = *reinterpret_cast <const uint32_t *>(
134+ & (*dst = *reinterpret_cast <const uint32_t *>(
135135 buf + LOG_BLOCK_HDR_NO));
136136#if LOG_BLOCK_HDR_NO + 4 != LOG_CRYPT_HDR_SIZE
137137# error "LOG_BLOCK_HDR_NO has been moved; redo log format affected!"
@@ -143,7 +143,8 @@ log_crypt(byte* buf, ulint size, bool decrypt)
143143log_block_no));
144144
145145int rc = encryption_crypt (
146- buf + LOG_CRYPT_HDR_SIZE, sizeof dst, dst, &dst_len,
146+ buf + LOG_CRYPT_HDR_SIZE, sizeof dst,
147+ reinterpret_cast <byte*>(dst), &dst_len,
147148const_cast <byte*>(info.crypt_key .bytes ),
148149sizeof info.crypt_key ,
149150reinterpret_cast <byte*>(aes_ctr_iv), sizeof aes_ctr_iv,
0 commit comments