Skip to content

Commit

Permalink
Fix theorbtwo#60 ?
Browse files Browse the repository at this point in the history
  • Loading branch information
vCybah committed Mar 2, 2023
1 parent 6aa28b5 commit c4dde70
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public static void writeJson(FriendlyByteBuf buf, JsonElement element) {
private static void writeJsonPrimitive(FriendlyByteBuf buf, JsonPrimitive primitive) {
if (primitive.isString()) {
buf.writeByte(1);
buf.writeUtf(primitive.getAsString());
buf.writeUtf(primitive.getAsString(), Integer.MAX_VALUE);
} else if (primitive.isBoolean()) {
buf.writeByte(primitive.getAsBoolean() ? 3 : 2);
} else if (primitive.isNumber()) {
Expand Down Expand Up @@ -210,7 +210,7 @@ public static JsonElement readJson(FriendlyByteBuf buf) {
private static JsonPrimitive readJsonPrimitive(int type, FriendlyByteBuf buf) {
switch (type) {
case 1:
return new JsonPrimitive(buf.readUtf());
return new JsonPrimitive(buf.readUtf(Integer.MAX_VALUE / 4));
case 2:
return new JsonPrimitive(false);
case 3:
Expand Down

0 comments on commit c4dde70

Please sign in to comment.