]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/pem/pem_info.c: avoid switching on PEM_INFO_NONE
authorEugene Syromiatnikov <esyr@openssl.org>
Tue, 30 Jun 2026 13:43:04 +0000 (15:43 +0200)
committerNorbert Pocs <norbertp@openssl.org>
Thu, 2 Jul 2026 07:26:18 +0000 (09:26 +0200)
Coverity complains that the switch statements in PEM_X509_INFO_read_bio_ex()
switches on PEM_INFO_NONE, while the enclosing condition
(itype != PEM_INFO_NONE) explicitly rules it out.  Pacify it by changing
the switch case to default (not removing it to avoid triggering
-Werror=switch).

Resolves: https://scan5.scan.coverity.com/#/project-view/65248/10222?selectedIssue=1695453
Complements: 0e8f2844ed3e "fix function pointer type mismatch in PEM_X509_INFO_read_bio_ex"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Thu Jul  2 07:26:24 2026
(Merged from https://github.com/openssl/openssl/pull/31792)

crypto/pem/pem_info.c

index d9bbb7256eee66362c9d9d62b9487f5666be1e10..fa189f0c5dadf4bdd7826e1b8f3c59f8010919d1 100644 (file)
@@ -192,7 +192,7 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk,
                         decoded = d2i_AutoPrivateKey_ex((EVP_PKEY **)pp, &p,
                             len, libctx, propq);
                         break;
-                    case PEM_INFO_NONE:
+                    default:
                         break;
                     }
                     if (decoded == NULL) {