diff options
author | MrRurikov <96385824+MrRurikov@users.noreply.github.com> | 2023-06-29 17:06:08 +0300 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-07-25 12:38:31 +0200 |
commit | 8ae4b236347d82226b6d86e02a9717e6a51d58a0 (patch) | |
tree | 1f3a365d7d41cd761187c2597f4ab20d93b4ae7c /crypto/bio | |
parent | 3ced3a44e8b2f5bb6ee3a61ae3d281061fc711f8 (diff) |
bio_print.c: Delete unreachable code at lines 710 and 711
CLA: trivial
The purpose of adding the conditional operator on line 710 is to check
if the value of the variable 'fplace' exceeds the size of the array
'fconvert', and to reduce the value of 'fplace' by 1, so that later on
we can set the value to zero of the array element with the index 'fplace'
and not make any calls beyond the array edges.
However, the condition on line 710 will always be false, because
the size of 'fconvert' is strictly specified at the beginning of
the 'fmtfp()' function (line 571), so it is reasonable to remove
this conditional operator, as well as the unreachable decrementation
code of the variable 'fplace'.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21325)
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bio_print.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/crypto/bio/bio_print.c b/crypto/bio/bio_print.c index 34787a29a7..1d8fa1c44d 100644 --- a/crypto/bio/bio_print.c +++ b/crypto/bio/bio_print.c @@ -707,8 +707,6 @@ fmtfp(char **sbuffer, fracpart = (fracpart / 10); } - if (fplace == sizeof(fconvert)) - fplace--; fconvert[fplace] = 0; /* convert exponent part */ |