add the annotation in the function of pg_md5_encrypt

This commit is contained in:
Egok4wryu 2022-10-20 11:13:26 +08:00
parent 200c9b14a7
commit 95b7221f15
1 changed files with 2 additions and 0 deletions

View File

@ -309,6 +309,7 @@ bool pg_md5_encrypt(const char* passwd, const char* salt, size_t salt_len, char*
{
size_t passwd_len = strlen(passwd);
errno_t rc = EOK;
/* the length of salt and password is <= SIZE_MAX */
#ifndef WIN32
if (unlikely(passwd_len >= SIZE_MAX - salt_len)) {
return false;
@ -322,6 +323,7 @@ bool pg_md5_encrypt(const char* passwd, const char* salt, size_t salt_len, char*
char* crypt_buf = (char*)malloc(passwd_len + salt_len + 1);
bool ret = false;
/* the buffer is not exist */
if (crypt_buf == NULL)
return false;