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


##########
cpp/src/parquet/metadata.cc:
##########
@@ -649,9 +649,12 @@ class FileMetaData::FileMetaDataImpl {
     std::string key = file_decryptor_->GetFooterKey();
     std::string aad = encryption::CreateFooterAad(file_decryptor_->file_aad());
 
-    auto aes_encryptor = encryption::AesEncryptor::Make(
-        file_decryptor_->algorithm(), static_cast<int>(key.size()), true,
-        false /*write_length*/, nullptr);
+    auto aes_encryptor = 
encryption::AesEncryptor::Make(file_decryptor_->algorithm(),
+                                                        
static_cast<int>(key.size()),
+                                                        true, false 
/*write_length*/);
+    if (ARROW_PREDICT_FALSE(aes_encryptor == nullptr)) {
+      throw ParquetException("Could not create AES encryptor for signature 
verification");

Review Comment:
   I think we should. Otherwise the logic below cannot run anyway.
   
   BTW, why not simply use `ARROW_CHECK`?



-- 
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