1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

Specify buffer sizes

This commit is contained in:
Andrew Bartlett -
parent 2effcae13f
commit aa12379b3f

View File

@ -66,7 +66,7 @@ static BOOL cli_session_setup_lanman2(struct cli_state *cli, const char *user,
memcpy(pword, pass, passlen); memcpy(pword, pass, passlen);
} else if (passlen > 0) { } else if (passlen > 0) {
/* Plaintext mode needed, assume plaintext supplied. */ /* Plaintext mode needed, assume plaintext supplied. */
passlen = clistr_push(cli, pword, pass, -1, STR_TERMINATE); passlen = clistr_push(cli, pword, pass, sizeof(pword), STR_TERMINATE);
} }
/* send a session setup command */ /* send a session setup command */
@ -778,7 +778,7 @@ BOOL cli_send_tconX(struct cli_state *cli,
/* /*
* Non-encrypted passwords - convert to DOS codepage before using. * Non-encrypted passwords - convert to DOS codepage before using.
*/ */
passlen = clistr_push(cli, pword, pass, -1, STR_TERMINATE); passlen = clistr_push(cli, pword, pass, sizeof(pword), STR_TERMINATE);
} else { } else {
memcpy(pword, pass, passlen); memcpy(pword, pass, passlen);
} }