mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3:passdb: Zero memory for plaintext_pw from 'struct samu'
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
parent
02f667587c
commit
035e2021fa
@ -899,10 +899,9 @@ bool pdb_set_pw_history(struct samu *sampass, const uint8_t *pwd, uint32_t histo
|
||||
|
||||
bool pdb_set_plaintext_pw_only(struct samu *sampass, const char *password, enum pdb_value_state flag)
|
||||
{
|
||||
if (password) {
|
||||
if (sampass->plaintext_pw!=NULL)
|
||||
memset(sampass->plaintext_pw,'\0',strlen(sampass->plaintext_pw)+1);
|
||||
BURN_STR(sampass->plaintext_pw);
|
||||
|
||||
if (password != NULL) {
|
||||
sampass->plaintext_pw = talloc_strdup(sampass, password);
|
||||
|
||||
if (!sampass->plaintext_pw) {
|
||||
|
@ -797,6 +797,8 @@ static PyObject *py_samu_get_plaintext_passwd(PyObject *obj, void *closure)
|
||||
}
|
||||
|
||||
py_plaintext_pw = PyUnicode_FromString(plaintext_pw);
|
||||
|
||||
BURN_STR(discard_const_p(char, plaintext_pw));
|
||||
talloc_free(frame);
|
||||
return py_plaintext_pw;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user