Fix oss-fuzz 67167.

Leak on startup and reload only, assuming a corrupt password file
provided by the admin. Minimal impact.
This commit is contained in:
Roger A. Light
2024-03-02 19:40:45 +00:00
parent f39ecb3d27
commit 34e07184e0
+1
View File
@@ -436,6 +436,7 @@ static int pw__decode_sha512(struct mosquitto_pw *pw, const char *salt_password)
rc = base64__decode(salt_b64, &salt, &salt_len);
if(rc != MOSQ_ERR_SUCCESS || (salt_len != 12 && salt_len != HASH_LEN)){
free(sp_heap);
free(salt);
return MOSQ_ERR_INVAL;
}
memcpy(pw->params.sha512.salt, salt, salt_len);