From 60148c9ee147105b36cbb8164cbb7b1c2249acb8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 7 Dec 2018 13:47:40 +0100 Subject: [PATCH] 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 --- source3/libsmb/pylibsmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }