In mech-plain and mech-dovecot-token the number of NULs splitting the
fields could have been higher then expected. This change ensures that if
there are more then the expected amount of NULs the authentication will
fail.
username = (const char *)data + i;
else if (count == 3)
session_id = (const char *)data + i;
- else {
+ else if (count == 4) {
len = data_size - i;
auth_token = p_strndup(unsafe_data_stack_pool,
data+i, len);
- break;
}
+ else
+ break;
}
}
if (data[i] == '\0') {
if (++count == 1)
authenid = (const char *) data + i+1;
- else {
+ else if (count == 2) {
i++;
len = data_size - i;
pass = p_strndup(unsafe_data_stack_pool,
data+i, len);
- break;
}
+ else
+ break;
}
}