Commit 25fb1ef8 authored by guus's avatar guus

Prevents a nasty 'indexoutofbounds' when illegal input occurs.

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10851 b35dd754-fafc-0310-a699-88a17e54d16e
parent 260cee3b
......@@ -188,6 +188,9 @@ public class IQAuthHandler extends IQHandler implements IQAuthInfo {
private IQ login(String username, Element iq, IQ packet, String password, LocalClientSession session, String digest)
throws UnauthorizedException, UserNotFoundException, ConnectionException, InternalUnauthenticatedException {
// Verify the validity of the username
if (username == null || username.trim().length() == 0) {
throw new UnauthorizedException("Invalid username (empty or null).");
}
try {
Stringprep.nodeprep(username);
} catch (StringprepException e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment