diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2019-07-07 13:47:51 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-07-22 22:20:26 +0000 |
commit | f8fb6f326129267c7742947943df3f920c8cb54f (patch) | |
tree | 55580524a66f22582f2c6decff9067aa559b30a6 /auth | |
parent | 95a5140db3e84478b903f9e96fc34e87db2c07c6 (diff) | |
download | samba-f8fb6f326129267c7742947943df3f920c8cb54f.tar.gz |
auth/pycreds/encrypt_netr_crypt_password: don't segfault
Non-talloc objects were treated as talloc objects, to no good effect
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth')
-rw-r--r-- | auth/credentials/pycredentials.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index 5002bb86e1c..91e9276473d 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -909,7 +909,12 @@ static PyObject *py_creds_encrypt_netr_crypt_password(PyObject *self, if (!PyArg_ParseTuple(args, "|O", &py_cp)) { return NULL; } + pwd = pytalloc_get_type(py_cp, struct netr_CryptPassword); + if (pwd == NULL) { + /* pytalloc_get_type sets TypeError */ + return NULL; + } data.length = sizeof(struct netr_CryptPassword); data.data = (uint8_t *)pwd; status = netlogon_creds_session_encrypt(creds->netlogon_creds, data); |