You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class Test {
public static void main(String[] args) throws Exception {
JSONObject obj1=new JSONObject();
obj1.put("",obj1);
obj1.toString();
}
}
Description:
Converting invalid JSONObject to String will result in stack overflow.
Log:
Exception in thread "main" java.lang.StackOverflowError
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:55)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
The text was updated successfully, but these errors were encountered:
Minimal reproducible example:
import org.json.simple.JSONObject;
Description:
Converting invalid JSONObject to String will result in stack overflow.
Log:
Exception in thread "main" java.lang.StackOverflowError
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:55)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:74)
at org.json.simple.JSONValue.writeJSONString(JSONValue.java:160)
at org.json.simple.JSONObject.writeJSONString(JSONObject.java:68)
The text was updated successfully, but these errors were encountered: