papermc/Spigot-Server-Patches/0156-Fix-AIOOBE-in-inventory-handling.patch

23 lines
1.1 KiB
Diff
Raw Normal View History

From 47ce11bab2409db675956daff0232adab29d0080 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Sun, 4 Sep 2016 16:35:43 -0500
Subject: [PATCH] Fix AIOOBE in inventory handling
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e01787021..a99ec1f10 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1808,7 +1808,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
case CLONE:
if (packetplayinwindowclick.c() == 2) {
click = ClickType.MIDDLE;
- if (packetplayinwindowclick.b() == -999) {
+ if (packetplayinwindowclick.b() < 0) { // Paper - GH-404
action = InventoryAction.NOTHING;
} else {
Slot slot = this.player.activeContainer.getSlot(packetplayinwindowclick.b());
--
2.12.0.windows.1