Skip to content

Commit

Permalink
Updated Upstream (Leaf)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Nov 11, 2023
1 parent 8f60ed5 commit b207092
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions patches/server/0039-Paper-Add-another-slot-sanity-check.patch
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();

0 comments on commit b207092

Please sign in to comment.