Do not crash when getting invalid string for scram

(cherry picked from commit 0c0aad1de09db9a2152855ebaa867dfe07745808)
This commit is contained in:
Stephen Paul Weber 2023-10-31 09:21:41 -05:00 committed by Arne
parent 2c4f14edf1
commit 00a0e950f2

View file

@ -150,7 +150,7 @@ abstract class ScramMechanism extends SaslMechanism {
int iterationCount = -1;
String salt = "";
for (final String token : tokenizer) {
if (token.charAt(1) == '=') {
if (token.length() > 1 && token.charAt(1) == '=') {
switch (token.charAt(0)) {
case 'i':
try {