From: Andres Freund Date: Mon, 9 Aug 2021 15:26:59 +0000 (-0700) Subject: Fix bogus assertion in BootstrapModeMain(). X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=e12694523e7e4482a052236f12d3d8b58be9a22c;p=users%2Frhaas%2Fpostgres.git Fix bogus assertion in BootstrapModeMain(). The assertion was always true, as written, thanks to me "simplifying" it before commit. Per coverity and Tom Lane. --- diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c index 3416802811..48615c0ebc 100644 --- a/src/backend/bootstrap/bootstrap.c +++ b/src/backend/bootstrap/bootstrap.c @@ -215,9 +215,9 @@ BootstrapModeMain(int argc, char *argv[], bool check_only) InitializeGUCOptions(); /* an initial --boot or --check should be present */ - Assert(argc == 1 - || strcmp(argv[1], "--boot") != 0 - || strcmp(argv[1], "--check") != 0); + Assert(argc > 1 + && (strcmp(argv[1], "--boot") == 0 + || strcmp(argv[1], "--check") == 0)); argv++; argc--;