]> granicus.if.org Git - python/commitdiff
bpo-37120: Fix _ssl get_num_tickets() (GH-14668)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 9 Jul 2019 12:42:49 +0000 (05:42 -0700)
committerGitHub <noreply@github.com>
Tue, 9 Jul 2019 12:42:49 +0000 (05:42 -0700)
Replace PyLong_FromLong() with PyLong_FromSize_t():
SSL_CTX_get_num_tickets() return type is size_t.

https://bugs.python.org/issue37120
(cherry picked from commit 76611c7c0af6b2f4d0d98a5db827d34cff54ce25)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Modules/_ssl.c

index 3351af6cdefdb327ee3baca6f673a780df2db528..da30cbb758e27ec1b8ed92fb5f7359d0d0104641 100644 (file)
@@ -3641,7 +3641,7 @@ set_maximum_version(PySSLContext *self, PyObject *arg, void *c)
 static PyObject *
 get_num_tickets(PySSLContext *self, void *c)
 {
-    return PyLong_FromLong(SSL_CTX_get_num_tickets(self->ctx));
+    return PyLong_FromSize_t(SSL_CTX_get_num_tickets(self->ctx));
 }
 
 static int