Skip to content

Commit

Permalink
Updated Upstream (Mirai)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Nov 11, 2023
1 parent e8abe19 commit 2664eff
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions patches/server/0096-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 04:03:34 -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 7bba845462813615224f48322c51c7b480adcaa7..aa412451354dc9e571c0eb9cab541513e75e80fb 100644
--- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -599,7 +599,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 2664eff

Please sign in to comment.