~singpolyma/cheogram-android

1b3b7f0a270a8e26cf35335d6804a27f7104055e — Stephen Paul Weber 10 months ago f586a5d
Punycode can throw index out of bounds
M src/main/java/eu/siacs/conversations/entities/Bookmark.java => src/main/java/eu/siacs/conversations/entities/Bookmark.java +1 -1
@@ 201,7 201,7 @@ public class Bookmark extends Element implements ListItem {
		} catch (final IllegalArgumentException e) {
			try {
				return tryFix ? getFullJid(gnu.inet.encoding.Punycode.encode(nick), false) : null;
			} catch (final gnu.inet.encoding.PunycodeException e2) {
			} catch (final gnu.inet.encoding.PunycodeException | ArrayIndexOutOfBoundsException e2) {
				return null;
			}
		}

M src/main/java/eu/siacs/conversations/entities/MucOptions.java => src/main/java/eu/siacs/conversations/entities/MucOptions.java +1 -1
@@ 620,7 620,7 @@ public class MucOptions {
        } catch (final IllegalArgumentException e) {
            try {
                return tryFix ? createJoinJid(gnu.inet.encoding.Punycode.encode(nick), false) : null;
            } catch (final gnu.inet.encoding.PunycodeException e2) {
            } catch (final gnu.inet.encoding.PunycodeException | ArrayIndexOutOfBoundsException e2) {
                return null;
            }
        }

M src/main/java/eu/siacs/conversations/parser/AbstractParser.java => src/main/java/eu/siacs/conversations/parser/AbstractParser.java +1 -1
@@ 154,7 154,7 @@ public abstract class AbstractParser {
			if (nickname != null && nick != null && !nick.equals(nickname) && gnu.inet.encoding.Punycode.decode(nick).equals(nickname)) {
				nick = nickname;
			}
		} catch (final gnu.inet.encoding.PunycodeException e) { }
		} catch (final gnu.inet.encoding.PunycodeException | ArrayIndexOutOfBoundsException e) { }
		MucOptions.User user = new MucOptions.User(conference.getMucOptions(), fullJid, nick);
		if (InvalidJid.isValid(realJid)) {
			user.setRealJid(realJid);