[Bug] Fix aes_decrypt to handle null input correctly. (#6636)

This commit is contained in:
Cui Kaifeng
2021-09-14 11:19:55 +08:00
committed by GitHub
parent 225bdb1fda
commit 020282e885
2 changed files with 25 additions and 3 deletions

View File

@ -33,7 +33,7 @@ void EncryptionFunctions::init() {}
StringVal EncryptionFunctions::aes_encrypt(FunctionContext* ctx, const StringVal& src,
const StringVal& key) {
if (src.len == 0) {
if (src.len == 0 || src.is_null) {
return StringVal::null();
}
@ -53,7 +53,7 @@ StringVal EncryptionFunctions::aes_encrypt(FunctionContext* ctx, const StringVal
StringVal EncryptionFunctions::aes_decrypt(FunctionContext* ctx, const StringVal& src,
const StringVal& key) {
if (src.len == 0) {
if (src.len == 0 || src.is_null) {
return StringVal::null();
}