From: Stefan Metzmacher Date: Fri, 7 Dec 2018 12:47:40 +0000 (+0100) Subject: s3:pylibsmb: make use of PyBytes_FromStringAndSize() in py_cli_read() X-Git-Tag: tdb-1.3.17~338 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=60148c9ee147105b36cbb8164cbb7b1c2249acb8;p=thirdparty%2Fsamba.git s3:pylibsmb: make use of PyBytes_FromStringAndSize() in py_cli_read() BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Stefan Metzmacher Reviewed-by: Tim Beale Reviewed-by: Andrew Bartlett --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 19587a8f074..bb1d2b7f427 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -794,7 +794,7 @@ static PyObject *py_cli_read(struct py_cli_state *self, PyObject *args, PyErr_SetNTSTATUS(status); return NULL; } - result = Py_BuildValue("s#", (char *)buf, (int)buflen); + result = PyBytes_FromStringAndSize((const char *)buf, buflen); TALLOC_FREE(req); return result; }