diff options
author | 2025-06-10 21:25:43 +0200 | |
---|---|---|
committer | 2025-06-10 21:25:43 +0200 | |
commit | 9d26a1636ba684b600b5cfa0e96e7cb648501539 (patch) | |
tree | 9c42deaaa965c99efa3ff03aa1ec0b3198ee7f73 | |
parent | 796d09d32de51e933bb300d9847c46e3a96eb9ac (diff) | |
download | libimobiledevice-9d26a1636ba684b600b5cfa0e96e7cb648501539.tar.gz libimobiledevice-9d26a1636ba684b600b5cfa0e96e7cb648501539.tar.bz2 |
idevice: Remove unused assignment in SSL bio callback for OpenSSL < 3.0
At the same time, make sure we don't set a negative value to *processed
for OpenSSL >= 3.0
-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 idevice_connection_t conn = (idevice_connection_t)BIO_get_callback_arg(b); #if OPENSSL_VERSION_NUMBER < 0x30000000L size_t len = (size_t)argi; - size_t *processed = (size_t*)&bytes; #endif switch (oper) { case (BIO_CB_READ|BIO_CB_RETURN): if (argp) { bytes = internal_ssl_read(conn, (char *)argp, len); - *processed = bytes; +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + *processed = (size_t)(bytes < 0) ? 0 : bytes; +#endif return (long)bytes; } return 0; @@ -1094,7 +1095,9 @@ static long ssl_idevice_bio_callback(BIO *b, int oper, const char *argp, int arg // fallthrough case (BIO_CB_WRITE|BIO_CB_RETURN): bytes = internal_ssl_write(conn, argp, len); - *processed = bytes; +#if OPENSSL_VERSION_NUMBER >= 0x30000000L + *processed = (size_t)(bytes < 0) ? 0 : bytes; +#endif return (long)bytes; default: return retvalue; |