Skip to content

Commit

Permalink
add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Jan 11, 2025
1 parent b6adb4a commit c87505c
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.alibaba.fastjson2.issues_3200;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONException;
import org.junit.jupiter.api.Test;

import java.nio.charset.StandardCharsets;

import static org.junit.jupiter.api.Assertions.assertThrows;

public class Issue3260 {
@Test
public void test() {
String str = "{\"dns\":[\"<>\"/'\"],\"operation\":\"init\"}";
assertThrows(
JSONException.class,
() -> JSON.parseObject(str));
assertThrows(
JSONException.class,
() -> JSON.parseObject(str.toCharArray()));
assertThrows(
JSONException.class,
() -> JSON.parseObject(str.getBytes(StandardCharsets.UTF_8)));
}
}

0 comments on commit c87505c

Please sign in to comment.