mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-27 00:32:07 +01:00
Protect against bad xmpp error types.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@5458 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
49a07980de
commit
48fac74878
1 changed files with 12 additions and 4 deletions
|
@ -337,8 +337,16 @@ public class PacketParserUtils {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new XMPPError(Integer.parseInt(errorCode), XMPPError.Type
|
// Parse the error type.
|
||||||
.valueOf(type.toUpperCase()), condition, message, extensions);
|
XMPPError.Type errorType = XMPPError.Type.CANCEL;
|
||||||
|
try {
|
||||||
|
errorType = XMPPError.Type.valueOf(type.toUpperCase());
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException iae) {
|
||||||
|
// Print stack trace. We shouldn't be getting an illegal error type.
|
||||||
|
iae.printStackTrace();
|
||||||
|
}
|
||||||
|
return new XMPPError(Integer.parseInt(errorCode), errorType, condition, message, extensions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue