Skip to content

Commit

Permalink
DX-61688 fixed out_len value for nullptr (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxlaykxx authored and lriggs committed Jul 21, 2023
1 parent b5b9be2 commit e922a6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cpp/src/gandiva/gdv_function_stubs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ const char* gdv_fn_aes_encrypt(int64_t context, const char* data, int32_t data_l
std::string err_msg =
"Could not allocate memory for returning aes encrypt cypher text";
gdv_fn_context_set_error_msg(context, err_msg.data());
*out_len = 0;
return nullptr;
}

Expand All @@ -333,6 +334,7 @@ const char* gdv_fn_aes_encrypt(int64_t context, const char* data, int32_t data_l
reinterpret_cast<unsigned char*>(ret));
} catch (const std::runtime_error& e) {
gdv_fn_context_set_error_msg(context, e.what());
*out_len = 0;
return nullptr;
}

Expand All @@ -356,6 +358,7 @@ const char* gdv_fn_aes_decrypt(int64_t context, const char* data, int32_t data_l
std::string err_msg =
"Could not allocate memory for returning aes encrypt cypher text";
gdv_fn_context_set_error_msg(context, err_msg.data());
*out_len = 0;
return nullptr;
}

Expand All @@ -364,6 +367,7 @@ const char* gdv_fn_aes_decrypt(int64_t context, const char* data, int32_t data_l
reinterpret_cast<unsigned char*>(ret));
} catch (const std::runtime_error& e) {
gdv_fn_context_set_error_msg(context, e.what());
*out_len = 0;
return nullptr;
}

Expand Down

0 comments on commit e922a6b

Please sign in to comment.