summaryrefslogtreecommitdiff
path: root/dev-python/pykerberos/files/pykerberos-1.3.1-python3.10.patch
blob: 7e760187de56aef397f33e6a94c8dbc7be81fa43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
https://bugs.gentoo.org/867421
https://github.com/apple/ccs-pykerberos/pull/89

From 1e1666af51bb11ea5c6dd442415ce765073737c3 Mon Sep 17 00:00:00 2001
From: stevenpackardblp <77253966+stevenpackardblp@users.noreply.github.com>
Date: Sun, 24 Oct 2021 23:03:41 -0400
Subject: [PATCH] Use Py_ssize_t type

Python 3.10 requires that the `Py_ssize_t` type is used for string lengths instead of `int`.
--- a/src/kerberos.c
+++ b/src/kerberos.c
@@ -14,6 +14,7 @@
  * limitations under the License.
  **/
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 
 #include "kerberosbasic.h"
@@ -244,9 +245,9 @@ static PyObject *channelBindings(PyObject *self, PyObject *args, PyObject* keywd
     char *initiator_address = NULL;
     char *acceptor_address = NULL;
     char *application_data = NULL;
-    int initiator_length = 0;
-    int acceptor_length = 0;
-    int application_length = 0;
+    Py_ssize_t initiator_length = 0;
+    Py_ssize_t acceptor_length = 0;
+    Py_ssize_t application_length = 0;
 
     PyObject *pychan_bindings = NULL;
     struct gss_channel_bindings_struct *input_chan_bindings;