eastlong
eastlong
# hook构造函数时,jsoniter组件序列化异常,自循环(递归),最终导致StackOverflowError ## 背景 我需要去hook构造函数。 ## 问题 程序在执行到com.baidu.openrasp.plugin.js.JS 的如下代码段 ```java public static List Check(CheckParameter checkParameter) { Type type = checkParameter.getType(); ByteArrayOutputStream out = new ByteArrayOutputStream(); JsonStream.serialize(checkParameter.getParams(), out); out.write(0); ``` 其中JsonStream.serialize(checkParameter.getParams(),...
Problem: JsonStream.serialize error,cause StackOverflowError ```java ByteArrayOutputStream out = new ByteArrayOutputStream(); JsonStream.serialize(checkParameter.getParams(), out); ``` remark:checkParameter.getParams() is a map. execute error: aused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at...
## 问题:递归循环报错,引发StackOverflowError ```java ByteArrayOutputStream out = new ByteArrayOutputStream(); JsonStream.serialize(checkParameter.getParams(), out); ``` 其中:checkParameter.getParams()是一个map 执行报错: aused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.baidu.openrasp.jsoniter.output.ReflectionObjectEncoder.enocde_(ReflectionObjectEncoder.java:77) ... 1020 more Caused by:...