Skip to content

Commit f065631

Browse files
author
‘niuerzhuang’
committed
fix: taint max length.
1 parent a1c863e commit f065631

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/models/MethodEvent.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class MethodEvent {
7676
/**
7777
* method all parameters string value
7878
*/
79-
public List<Parameter> parameterValues = new ArrayList<Parameter>();
79+
public List<Parameter> parameterValues = new ArrayList<>();
8080

8181
/**
8282
* method return instance
@@ -88,13 +88,13 @@ public class MethodEvent {
8888
*/
8989
public String returnValue;
9090

91-
private final Set<Long> sourceHashes = new HashSet<Long>();
91+
private final Set<Long> sourceHashes = new HashSet<>();
9292

93-
private final Set<Long> targetHashes = new HashSet<Long>();
93+
private final Set<Long> targetHashes = new HashSet<>();
9494

95-
public List<MethodEventTargetRange> targetRanges = new ArrayList<MethodEventTargetRange>();
95+
public List<MethodEventTargetRange> targetRanges = new ArrayList<>();
9696

97-
public List<MethodEventTargetRange> sourceRanges = new ArrayList<MethodEventTargetRange>();
97+
public List<MethodEventTargetRange> sourceRanges = new ArrayList<>();
9898

9999
public List<MethodEventSourceType> sourceTypes;
100100

@@ -232,7 +232,7 @@ public void addParameterValue(int index, Object param, boolean hasTaint) {
232232
if (param == null) {
233233
return;
234234
}
235-
String indexString = "P" + String.valueOf(index + 1);
235+
String indexString = "P" + (index + 1);
236236
Parameter parameter = new Parameter(indexString, formatValue(param, hasTaint));
237237
this.parameterValues.add(parameter);
238238
}
@@ -247,7 +247,7 @@ public void setReturnValue(Object ret, boolean hasTaint) {
247247
private String formatValue(Object val, boolean hasTaint) {
248248
String str = obj2String(val);
249249
return "[" + StringUtils.normalize(str, MAX_VALUE_LENGTH) + "]"
250-
+ (hasTaint ? "*" : "") + String.valueOf(str.length());
250+
+ (hasTaint ? "*" : "") + str.length();
251251
}
252252

253253
public Set<Long> getSourceHashes() {

dongtai-core/src/main/java/io/dongtai/iast/core/utils/PropertyUtils.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ public class PropertyUtils {
2323
private String iastDumpPath;
2424
private Long heartBeatInterval = -1L;
2525
private String serverUrl;
26-
private String serverMode;
2726
private String proxyEnableStatus;
2827
private String proxyHost;
2928
private int proxyPort = -1;
30-
private String debugFlag;
3129
private Integer responseLength;
3230
private String policyPath;
3331
private static List<String> disabledFeatureList;
@@ -183,13 +181,6 @@ public int getProxyPort() {
183181
return proxyPort;
184182
}
185183

186-
private String getDebugFlag() {
187-
if (debugFlag == null) {
188-
debugFlag = System.getProperty(PropertyConstant.PROPERTY_DEBUG, "false");
189-
}
190-
return debugFlag;
191-
}
192-
193184
public Integer getResponseLength() {
194185
if (responseLength == null) {
195186
responseLength = Integer.parseInt(System.getProperty(PropertyConstant.PROPERTY_RESPONSE_LENGTH,

0 commit comments

Comments
 (0)