Update to 1.8.4
This commit is contained in:
45
CraftBukkit-Patches/0129-Safer-JSON-Loading.patch
Normal file
45
CraftBukkit-Patches/0129-Safer-JSON-Loading.patch
Normal file
@@ -0,0 +1,45 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Suddenly <suddenly@suddenly.coffee>
|
||||
Date: Tue, 8 Jul 2014 09:44:18 +1000
|
||||
Subject: [PATCH] Safer JSON Loading
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/JsonList.java
|
||||
+++ b/src/main/java/net/minecraft/server/JsonList.java
|
||||
@@ -0,0 +0,0 @@ public class JsonList<K, V extends JsonListEntry<K>> {
|
||||
try {
|
||||
bufferedreader = Files.newReader(this.c, Charsets.UTF_8);
|
||||
collection = (Collection) this.b.fromJson(bufferedreader, JsonList.f);
|
||||
+ // Spigot Start
|
||||
+ } catch ( java.io.FileNotFoundException ex )
|
||||
+ {
|
||||
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.INFO, "Unable to find file {0}, creating it.", this.c );
|
||||
+ } catch ( com.google.gson.JsonSyntaxException ex )
|
||||
+ {
|
||||
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.WARNING, "Unable to read file {0}, backing it up to {0}.backup and creating new copy.", this.c );
|
||||
+ File backup = new File( this.c + ".backup" );
|
||||
+ this.c.renameTo( backup );
|
||||
+ this.c.delete();
|
||||
+ // Spigot End
|
||||
} finally {
|
||||
IOUtils.closeQuietly(bufferedreader);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/UserCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/UserCache.java
|
||||
@@ -0,0 +0,0 @@ public class UserCache {
|
||||
}
|
||||
} catch (FileNotFoundException filenotfoundexception) {
|
||||
;
|
||||
+ // Spigot Start
|
||||
+ } catch (com.google.gson.JsonSyntaxException ex) {
|
||||
+ JsonList.a.warn( "Usercache.json is corrupted or has bad formatting. Deleting it to prevent further issues." );
|
||||
+ this.g.delete();
|
||||
+ // Spigot End
|
||||
} catch (JsonParseException jsonparseexception) {
|
||||
;
|
||||
} finally {
|
||||
--
|
||||
Reference in New Issue
Block a user