mapleFU commented on code in PR #43222:
URL: https://github.com/apache/arrow/pull/43222#discussion_r1674173447


##########
cpp/src/parquet/encryption/internal_file_encryptor.cc:
##########
@@ -150,8 +150,8 @@ encryption::AesEncryptor* 
InternalFileEncryptor::GetMetaAesEncryptor(
   int key_len = static_cast<int>(key_size);
   int index = MapKeyLenToEncryptorArrayIndex(key_len);
   if (meta_encryptor_[index] == nullptr) {
-    meta_encryptor_[index].reset(
-        encryption::AesEncryptor::Make(algorithm, key_len, true, 
&all_encryptors_));
+    meta_encryptor_[index] = encryption::AesEncryptor::Make(algorithm, 
key_len, true);
+    all_encryptors_.push_back(meta_encryptor_[index].get());

Review Comment:
   ```
     // Key must be 16, 24 or 32 bytes in length. Thus there could be up to 
three
     // types of meta_encryptors and data_encryptors.
     std::unique_ptr<encryption::AesEncryptor> meta_encryptor_[3];
     std::unique_ptr<encryption::AesEncryptor> data_encryptor_[3];
   ```
   
   And from the comment it might be nullptr



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to