mirror of
https://github.com/openssl/openssl.git
synced 2026-01-18 17:11:31 +01:00
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ý <sashan@openssl.org> Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org> (Merged from https://github.com/openssl/openssl/pull/29525)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user