From: Jo Sutton Date: Mon, 6 May 2024 23:43:48 +0000 (+1200) Subject: auth:credentials: Check for NT hash being NULL X-Git-Tag: tdb-1.4.11~683 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7b02221c4f5571255d2d6124ba1ea5c8fcda6eb4;p=thirdparty%2Fsamba.git auth:credentials: Check for NT hash being NULL Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index 0bcb894f920..8008bd0418d 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -544,6 +544,9 @@ static PyObject *py_creds_get_nt_hash(PyObject *self, PyObject *unused) return NULL; } ntpw = cli_credentials_get_nt_hash(creds, creds); + if (ntpw == NULL) { + Py_RETURN_NONE; + } ret = PyBytes_FromStringAndSize(discard_const_p(char, ntpw->hash), 16); TALLOC_FREE(ntpw);