-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f60ed5
commit b207092
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
patches/server/0039-Paper-Add-another-slot-sanity-check.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> | ||
Date: Sat, 11 Nov 2023 03:50:55 -0500 | ||
Subject: [PATCH] Paper: Add another slot sanity check | ||
|
||
Original code by PaperMC, licensed under GPL v3 | ||
You can find the original code on https://github.com/PaperMC/Paper/commit/8493340be4fa69fa9369719272e5dff1b7a2f455 | ||
|
||
This patch fixed a packet exploit that affects 1.20.1/2 | ||
|
||
diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java | ||
index 38d47fbcd49cc291040ea00470abeb982fe2714c..662f3eee6ff17e0b0191b1c59066465db818ed2b 100644 | ||
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java | ||
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java | ||
@@ -600,7 +600,7 @@ public abstract class AbstractContainerMenu { | ||
int j2; | ||
|
||
if (actionType == ClickType.SWAP) { | ||
- if (slotIndex < 0) return; // Paper | ||
+ if (slotIndex < 0 || button < 0) return; // Paper | ||
slot2 = (Slot) this.slots.get(slotIndex); | ||
itemstack1 = playerinventory.getItem(button); | ||
itemstack = slot2.getItem(); |