[SQL][Function] Fix from/to_base64 may return incorrect value (#4183)

from/to_base64 may return incorrect value when the value is null #4130 
remove the duplicated base64 code
fix the base64 encoded string length is wrong, and this will cause the memory error
This commit is contained in:
Zhengguo Yang
2020-07-27 22:55:05 +08:00
committed by GitHub
parent 9e5ca697f3
commit 50e6a2c8a0
11 changed files with 100 additions and 220 deletions

View File

@ -184,7 +184,7 @@ size_t base64_encode(const unsigned char* data, size_t length, unsigned char* en
return output_length;
}
static inline int64_t base64_decode(const char* data, size_t length, char* decoded_data) {
int64_t base64_decode(const char* data, size_t length, char* decoded_data) {
const char* current = data;
int ch = 0;
int i = 0;