Skip to content

Commit 766f7fd

Browse files
committed
Add "break"s to make it clearer what will happen in a nested switch.
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.
1 parent 835cc11 commit 766f7fd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/libpq/crypt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ encrypt_password(PasswordType target_type, const char *role,
162162
case PASSWORD_TYPE_MD5:
163163
return pstrdup(password);
164164
}
165+
break;
165166

166167
case PASSWORD_TYPE_SCRAM:
167168
switch (guessed_type)
@@ -178,6 +179,7 @@ encrypt_password(PasswordType target_type, const char *role,
178179
case PASSWORD_TYPE_SCRAM:
179180
return pstrdup(password);
180181
}
182+
break;
181183
}
182184

183185
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy