[openssl/openssl] 8ae4b2: bio_print.c: Delete unreachable code at lines 710 ...

MrRurikov noreply at github.com
Tue Jul 25 10:42:08 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 8ae4b236347d82226b6d86e02a9717e6a51d58a0
      https://github.com/openssl/openssl/commit/8ae4b236347d82226b6d86e02a9717e6a51d58a0
  Author: MrRurikov <96385824+MrRurikov at users.noreply.github.com>
  Date:   2023-07-25 (Tue, 25 Jul 2023)

  Changed paths:
    M crypto/bio/bio_print.c

  Log Message:
  -----------
  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 at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21325)




More information about the openssl-commits mailing list