Mojira Archive
MC-116425

Invalid Map Can Crash Server

Corollary to MC-80483

If a map is sent with a negative decoration type, the server will crash. This can be done with a modded client and creative mode.

Easiest fix is to just clamp it to the default:

    public static enum Type {

        PLAYER(false), FRAME(true), RED_MARKER(false), BLUE_MARKER(false), TARGET_X(true), TARGET_POINT(true), PLAYER_OFF_MAP(false), PLAYER_OFF_LIMITS(false), MANSION(true, 5393476), MONUMENT(true, 3830373);

        private final byte k;
        private final boolean l;
        private final int m;

        private Type(boolean flag) {
            this(flag, -1);
        }

        private Type(boolean flag, int i) {
            this.k = (byte) this.ordinal();
            this.l = flag;
            this.m = i;
        }

        public byte a() {
            return this.k;
        }

        public boolean c() {
            return this.m >= 0;
        }

        public int d() {
            return this.m;
        }

        public static MapIcon.Type a(byte b0) {
            return b0 >= 0 && b0 < values().length ? values()[b0] : MapIcon.Type.PLAYER; // CraftBukkit
        }
    }

Fixed

[Mod] md_5

[Mojang] Nathan Adams

2017-04-21, 01:22 AM

2017-05-16, 03:04 PM

2017-05-16, 03:04 PM

3

1

Unconfirmed

crash, exploit, map, server

Minecraft 1.11.2

Minecraft 1.12 Pre-Release 3