diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2023-04-24 11:13:38 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-05-05 02:54:31 +0000 |
commit | db889249abbab81964e1cb3033b6a08b7a6361f4 (patch) | |
tree | 59176b83bbfcbf1d522ade1e866480395b38004b /auth | |
parent | bd9eb63450ff45a9c3d49ca5c9f7b2c8aaa2060b (diff) | |
download | samba-db889249abbab81964e1cb3033b6a08b7a6361f4.tar.gz |
auth/credentials: Fix NULL dereference
We should not pass a NULL pointer to netlogon_creds_session_encrypt().
Signed-off-by: Joseph Sutton <josephsutton@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 41a9d597435..ac9ccd4ae27 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -1033,6 +1033,11 @@ static PyObject *py_creds_encrypt_samr_password(PyObject *self, return NULL; } + if (creds->netlogon_creds == NULL) { + PyErr_Format(PyExc_ValueError, "NetLogon credentials not set"); + return NULL; + } + if (!PyArg_ParseTuple(args, "O", &py_cp)) { return NULL; } |