Skip to content

Commit

Permalink
fix a warning in C code via explicit cast (#8280)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Feb 13, 2023
1 parent 4de381c commit af68e9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/_cffi_src/openssl/callbacks.py
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit af68e9d

Please sign in to comment.