From: Neil Horman Date: Tue, 30 Dec 2025 18:52:38 +0000 (-0500) Subject: Fix more dead code in b64_write X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b69cc994cbc5dff5daf890ef3e34916a08ee689;p=thirdparty%2Fopenssl.git Fix more dead code in b64_write https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=1677831 reports more dead code in b64_write ret is incremented by inl in b64_write prior to being tested for zero. Since inl is previously tested for being <= 0, and returns if it is, ret must be at least 1 during the test, making the trinary test dead code. Just return -1 here. Reviewed-by: Saša Nedvědický Reviewed-by: Nikola Pajkovsky (Merged from https://github.com/openssl/openssl/pull/29525) --- diff --git a/crypto/evp/bio_b64.c b/crypto/evp/bio_b64.c index 0079268e46d..7b3decd2bfd 100644 --- a/crypto/evp/bio_b64.c +++ b/crypto/evp/bio_b64.c @@ -411,10 +411,8 @@ static int b64_write(BIO *b, const char *in, int inl) } ret += inl; i = BIO_write(next, encoded, n_bytes_enc); - if (i <= 0) { + if (i <= 0) BIO_copy_next_retry(b); - return ret == 0 ? i : ret; - } return ret; }