diff options
author | Gary Lockyer <gary@catalyst.net.nz> | 2017-04-28 13:14:16 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-05-25 02:25:13 +0200 |
commit | 610919e5e665dcb23241055e8ccb11f3d3f2ae2c (patch) | |
tree | 431cb81d96e1e973adeeb76e22415c1f20ffdd64 /auth/credentials | |
parent | ee0eb1daa349671386bae0121be6a4b8be06815d (diff) | |
download | samba-610919e5e665dcb23241055e8ccb11f3d3f2ae2c.tar.gz |
auth pycredentials: incorrect PyArg_ParseTupleAndKeywords call
The challenge parameter was being treated as a string rather than as a
data blob. This was causing intermittent seg faults. Removed the
server_timestamp parameter as it's not currently used.
Unable to produce a test case to reliably replicate the failure.
However auth_log_samlogon does flap
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'auth/credentials')
-rw-r--r-- | auth/credentials/pycredentials.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c index 165f8031e70..fee9556b180 100644 --- a/auth/credentials/pycredentials.c +++ b/auth/credentials/pycredentials.c @@ -90,16 +90,19 @@ static PyObject *py_creds_get_ntlm_response(PyObject *self, PyObject *args, PyOb DATA_BLOB lm_session_key = data_blob_null; DATA_BLOB nt_session_key = data_blob_null; const char *kwnames[] = { "flags", "challenge", - "target_info", "server_timestamp", + "target_info", NULL }; tv_now = timeval_current(); server_timestamp = timeval_to_nttime(&tv_now); - if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "i" PYARG_BYTES_LEN "|" PYARG_BYTES_LEN "K", + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "is#|s#", discard_const_p(char *, kwnames), - &flags, &challenge, &target_info.data, &target_info.length)) { + &flags, + &challenge.data, + &challenge.length, + &target_info.data, + &target_info.length)) { return NULL; } |