Add "break"s to make it clearer what will happen in a nested switch.
authorTom Lane <[email protected]>
Sun, 12 Mar 2017 20:01:33 +0000 (16:01 -0400)
committerTom Lane <[email protected]>
Sun, 12 Mar 2017 20:01:33 +0000 (16:01 -0400)
This could only matter if the guessed_type variable had a value that wasn't
a member of the PasswordType enum; but just in case, let's be sure that
control falls out to reach the elog(ERROR) at the end of the function.
Per gripe from Coverity.

src/backend/libpq/crypt.c

index bd3e936d38cf3dc8be41287b52efafbd2d844646..9f0ae15b00ea16d3bf70b61e6c38041476a9d746 100644 (file)
@@ -162,6 +162,7 @@ encrypt_password(PasswordType target_type, const char *role,
                case PASSWORD_TYPE_MD5:
                    return pstrdup(password);
            }
+           break;
 
        case PASSWORD_TYPE_SCRAM:
            switch (guessed_type)
@@ -178,6 +179,7 @@ encrypt_password(PasswordType target_type, const char *role,
                case PASSWORD_TYPE_SCRAM:
                    return pstrdup(password);
            }
+           break;
    }
 
    /*