From: Joseph Sutton Date: Sun, 23 Apr 2023 23:13:38 +0000 (+1200) Subject: auth/credentials: Fix NULL dereference X-Git-Tag: talloc-2.4.1~753 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db889249abbab81964e1cb3033b6a08b7a6361f4;p=thirdparty%2Fsamba.git auth/credentials: Fix NULL dereference We should not pass a NULL pointer to netlogon_creds_session_encrypt(). Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- 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; }