From af68e9d2169617d1546fbf5d293a0c54453dd419 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 13 Feb 2023 08:36:11 -0500 Subject: [PATCH] fix a warning in C code via explicit cast (#8280) --- src/_cffi_src/openssl/callbacks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_cffi_src/openssl/callbacks.py b/src/_cffi_src/openssl/callbacks.py index 79d4f24bcee9..57a393686197 100644 --- a/src/_cffi_src/openssl/callbacks.py +++ b/src/_cffi_src/openssl/callbacks.py @@ -31,7 +31,7 @@ } CRYPTOGRAPHY_PASSWORD_DATA; int Cryptography_pem_password_cb(char *buf, int size, - int rwflag, void *userdata) { + int rwflag, void *userdata) { /* The password cb is only invoked if OpenSSL decides the private key is encrypted. So this path only occurs if it needs a password */ CRYPTOGRAPHY_PASSWORD_DATA *st = (CRYPTOGRAPHY_PASSWORD_DATA *)userdata; @@ -41,7 +41,7 @@ st->error = -1; return 0; } else if (st->length < size) { - memcpy(buf, st->password, st->length); + memcpy(buf, st->password, (size_t)st->length); return st->length; } else { st->error = -2;