recent updates triggered this coverity issues:
https://scan5.scan.coverity.com/#/project-view/60762/10222?selectedIssue=
1677834
Because ret is initalized to zero, and checked prior to any further
update, the first return statement in this change is unreachable
Further the return ret == 0 ? i : ret statement makes teh setting of
buf_len and buf_off unreachable.
Remove all of this unreachable code
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)
int n_bytes_enc = 0;
if (!EVP_EncodeUpdate(ctx->base64, encoded, &n_bytes_enc,
(unsigned char *)in, inl)) {
- if (ret == 0)
- return -1;
- return ret;
+ return -1;
}
ret += inl;
i = BIO_write(next, encoded, n_bytes_enc);
if (i <= 0) {
BIO_copy_next_retry(b);
return ret == 0 ? i : ret;
- ctx->buf_len = 0;
- ctx->buf_off = 0;
}
return ret;
}