diff options
Diffstat (limited to 'src/idevice.c')
| -rw-r--r-- | src/idevice.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/idevice.c b/src/idevice.c index 2252d22..0af27fd 100644 --- a/src/idevice.c +++ b/src/idevice.c | |||
| @@ -1079,13 +1079,14 @@ static long ssl_idevice_bio_callback(BIO *b, int oper, const char *argp, int arg | |||
| 1079 | idevice_connection_t conn = (idevice_connection_t)BIO_get_callback_arg(b); | 1079 | idevice_connection_t conn = (idevice_connection_t)BIO_get_callback_arg(b); |
| 1080 | #if OPENSSL_VERSION_NUMBER < 0x30000000L | 1080 | #if OPENSSL_VERSION_NUMBER < 0x30000000L |
| 1081 | size_t len = (size_t)argi; | 1081 | size_t len = (size_t)argi; |
| 1082 | size_t *processed = (size_t*)&bytes; | ||
| 1083 | #endif | 1082 | #endif |
| 1084 | switch (oper) { | 1083 | switch (oper) { |
| 1085 | case (BIO_CB_READ|BIO_CB_RETURN): | 1084 | case (BIO_CB_READ|BIO_CB_RETURN): |
| 1086 | if (argp) { | 1085 | if (argp) { |
| 1087 | bytes = internal_ssl_read(conn, (char *)argp, len); | 1086 | bytes = internal_ssl_read(conn, (char *)argp, len); |
| 1088 | *processed = bytes; | 1087 | #if OPENSSL_VERSION_NUMBER >= 0x30000000L |
| 1088 | *processed = (size_t)(bytes < 0) ? 0 : bytes; | ||
| 1089 | #endif | ||
| 1089 | return (long)bytes; | 1090 | return (long)bytes; |
| 1090 | } | 1091 | } |
| 1091 | return 0; | 1092 | return 0; |
| @@ -1094,7 +1095,9 @@ static long ssl_idevice_bio_callback(BIO *b, int oper, const char *argp, int arg | |||
| 1094 | // fallthrough | 1095 | // fallthrough |
| 1095 | case (BIO_CB_WRITE|BIO_CB_RETURN): | 1096 | case (BIO_CB_WRITE|BIO_CB_RETURN): |
| 1096 | bytes = internal_ssl_write(conn, argp, len); | 1097 | bytes = internal_ssl_write(conn, argp, len); |
| 1097 | *processed = bytes; | 1098 | #if OPENSSL_VERSION_NUMBER >= 0x30000000L |
| 1099 | *processed = (size_t)(bytes < 0) ? 0 : bytes; | ||
| 1100 | #endif | ||
| 1098 | return (long)bytes; | 1101 | return (long)bytes; |
| 1099 | default: | 1102 | default: |
| 1100 | return retvalue; | 1103 | return retvalue; |
