forked from I2P_Developers/i2p.i2p
* IRC Server: Fix IOOBE (ticket #559)
This commit is contained in:
@@ -198,15 +198,13 @@ public class I2PTunnelIRCServer extends I2PTunnelServer implements Runnable {
|
||||
String field[]=s.split(" ",5);
|
||||
String command;
|
||||
int idx=0;
|
||||
|
||||
if(field[0].charAt(0)==':')
|
||||
idx++;
|
||||
|
||||
try {
|
||||
if (field[0].charAt(0) == ':')
|
||||
idx++;
|
||||
command = field[idx++].toUpperCase(Locale.US);
|
||||
} catch (IndexOutOfBoundsException ioobe) {
|
||||
// wtf, server sent borked command?
|
||||
throw new IOException("Dropping defective message: index out of bounds while extracting command.");
|
||||
throw new IOException("Dropping defective message: [" + s + ']');
|
||||
}
|
||||
|
||||
if ("USER".equals(command)) {
|
||||
|
||||
@@ -55,12 +55,13 @@ abstract class IRCFilter {
|
||||
"CAP"
|
||||
};
|
||||
|
||||
if(field[0].charAt(0)==':')
|
||||
idx++;
|
||||
|
||||
try { command = field[idx++].toUpperCase(Locale.US); }
|
||||
catch (IndexOutOfBoundsException ioobe) // wtf, server sent borked command?
|
||||
{
|
||||
try {
|
||||
if (field[0].charAt(0) == ':')
|
||||
idx++;
|
||||
command = field[idx++].toUpperCase(Locale.US);
|
||||
} catch (IndexOutOfBoundsException ioobe) {
|
||||
// wtf, server sent borked command?
|
||||
//_log.warn("Dropping defective message: index out of bounds while extracting command.");
|
||||
return null;
|
||||
}
|
||||
@@ -151,6 +152,7 @@ abstract class IRCFilter {
|
||||
// Commands that regular users might use
|
||||
"ADMIN",
|
||||
"AWAY", // should be harmless
|
||||
"CAP", // http://tools.ietf.org/html/draft-mitchell-irc-capabilities-01
|
||||
"CYCLE",
|
||||
"DCCALLOW",
|
||||
"HELPME", "HELPOP", // helpop is what unrealircd uses by default
|
||||
@@ -226,12 +228,9 @@ abstract class IRCFilter {
|
||||
"TEMPSHUN",
|
||||
"UNDCCDENY",
|
||||
"WALLOPS",
|
||||
"ZLINE",
|
||||
// http://tools.ietf.org/html/draft-mitchell-irc-capabilities-01
|
||||
"CAP"
|
||||
"ZLINE"
|
||||
};
|
||||
_allowedOutbound = new HashSet(64);
|
||||
_allowedOutbound.addAll(Arrays.asList(allowedCommands));
|
||||
_allowedOutbound = new HashSet(Arrays.asList(allowedCommands));
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user