Switch index length check around to prevent crashes

This commit is contained in:
md_5 2013-07-04 12:09:15 +10:00
parent 1fbd057e42
commit fec1763e6d
3 changed files with 16 additions and 14 deletions

View File

@ -1,4 +1,4 @@
From b5740ad8b2744ba6b929533836aead5cc5e1c061 Mon Sep 17 00:00:00 2001
From 5be525c5bc3bd8ad23a17716a35fa76d638a7c32 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:20:49 +1000
Subject: [PATCH] BungeeCord Support
@ -107,4 +107,5 @@ index 60c0875..dab3c5c 100644
* Gets the current result of the login, as an enum
*
--
1.8.1.msysgit.1
1.8.1.2

View File

@ -1,4 +1,4 @@
From e1563b1f3e9a679ef61878a5b6e3fc2d0c4f6dc3 Mon Sep 17 00:00:00 2001
From a5ed58c6aa2dfef8c8b51fc9c6dfbf4d5e993983 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Sun, 2 Jun 2013 15:57:09 +1000
Subject: [PATCH] Add Particle API
@ -320,10 +320,10 @@ index e14fe40..9ae9b2d 100644
* Represents various map environment types that a world may be
*/
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0c46c84..5b2d0f9 100644
index 724f601..376ceef 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -661,6 +661,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -681,6 +681,11 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
{
throw new UnsupportedOperationException( "Not supported yet." );
}

View File

@ -1,4 +1,4 @@
From b49341b577917fd16fd7dbbd424cfba241742f6e Mon Sep 17 00:00:00 2001
From e795b98bec6778f4f4b8a59ca061fc61d1d6bfff Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Thu, 16 May 2013 18:51:05 +1000
Subject: [PATCH] Orebfuscator
@ -29,7 +29,7 @@ index 758d447..1d1c88c 100644
double d0 = (double) ((float) i + this.world.random.nextFloat());
double d1 = (double) ((float) j + this.world.random.nextFloat());
diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java
index 3c3bdbf..4c24f80 100644
index fa10397..91d7feb 100644
--- a/src/main/java/net/minecraft/server/Packet51MapChunk.java
+++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java
@@ -33,6 +33,7 @@ public class Packet51MapChunk extends Packet {
@ -108,10 +108,10 @@ index d77a4cc..4aa9ab7 100644
diff --git a/src/main/java/org/spigotmc/AntiXray.java b/src/main/java/org/spigotmc/AntiXray.java
new file mode 100644
index 0000000..c29b789
index 0000000..48c8a99
--- /dev/null
+++ b/src/main/java/org/spigotmc/AntiXray.java
@@ -0,0 +1,203 @@
@@ -0,0 +1,204 @@
+package org.spigotmc;
+
+import gnu.trove.set.TByteSet;
@ -218,6 +218,11 @@ index 0000000..c29b789
+ {
+ for ( int x = 0; x < 16; x++ )
+ {
+ // For some reason we can get too far ahead of ourselves (concurrent modification on bulk chunks?) so if we do, just abort and move on
+ if ( index >= buffer.length )
+ {
+ continue;
+ }
+ // Grab the block ID in the buffer.
+ // TODO: extended IDs are not yet supported
+ int blockId = buffer[index] & 0xFF;
@ -250,11 +255,7 @@ index 0000000..c29b789
+ }
+ }
+
+ // For some reason we can get too far ahead of ourselves (concurrent modification on bulk chunks?) so if we do, just abort and move on
+ if ( ++index >= buffer.length )
+ {
+ return;
+ }
+ index++;
+ }
+ }
+ }