mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
pgcrypto: Detect and report too-short crypt() salts.
Certain short salts crashed the backend or disclosed a few bytes of backend memory. For existing salt-induced error conditions, emit a message saying as much. Back-patch to 9.0 (all supported versions). Josh Kupershmidt Security: CVE-2015-5288
This commit is contained in:
@ -42,7 +42,7 @@ run_crypt_des(const char *psw, const char *salt,
|
||||
char *res;
|
||||
|
||||
res = px_crypt_des(psw, salt);
|
||||
if (strlen(res) > len - 1)
|
||||
if (res == NULL || strlen(res) > len - 1)
|
||||
return NULL;
|
||||
strcpy(buf, res);
|
||||
return buf;
|
||||
|
Reference in New Issue
Block a user