Skip to content

Commit 858138e

Browse files
Michal StruweSESA747457
authored andcommitted
session_server_ssh: make hash buffer static to avoid large call stack
1 parent 5c7c4e4 commit 858138e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/session_server_ssh.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,12 @@ static int
625625
nc_server_ssh_compare_password(const char *stored_pw, const char *received_pw)
626626
{
627627
char *received_pw_hash = NULL;
628-
struct crypt_data cdata = {0};
628+
static struct crypt_data cdata;
629629

630630
NC_CHECK_ARG_RET(NULL, stored_pw, received_pw, 1);
631631

632+
memset(&cdata, 0, sizeof(struct crypt_data));
633+
632634
if (!stored_pw[0]) {
633635
if (!received_pw[0]) {
634636
WRN(NULL, "User authentication successful with an empty password!");

0 commit comments

Comments
 (0)