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)
}
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;
}