Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX-61688 fixed out_len value for nullptr #24

Merged
merged 1 commit into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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