Skip to content

Commit

Permalink
fix: taint max length.
Browse files Browse the repository at this point in the history
  • Loading branch information
‘niuerzhuang’ committed Aug 29, 2023
1 parent a1c863e commit f065631
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class MethodEvent {
/**
* method all parameters string value
*/
public List<Parameter> parameterValues = new ArrayList<Parameter>();
public List<Parameter> parameterValues = new ArrayList<>();

/**
* method return instance
Expand All @@ -88,13 +88,13 @@ public class MethodEvent {
*/
public String returnValue;

private final Set<Long> sourceHashes = new HashSet<Long>();
private final Set<Long> sourceHashes = new HashSet<>();

private final Set<Long> targetHashes = new HashSet<Long>();
private final Set<Long> targetHashes = new HashSet<>();

public List<MethodEventTargetRange> targetRanges = new ArrayList<MethodEventTargetRange>();
public List<MethodEventTargetRange> targetRanges = new ArrayList<>();

public List<MethodEventTargetRange> sourceRanges = new ArrayList<MethodEventTargetRange>();
public List<MethodEventTargetRange> sourceRanges = new ArrayList<>();

public List<MethodEventSourceType> sourceTypes;

Expand Down Expand Up @@ -232,7 +232,7 @@ public void addParameterValue(int index, Object param, boolean hasTaint) {
if (param == null) {
return;
}
String indexString = "P" + String.valueOf(index + 1);
String indexString = "P" + (index + 1);
Parameter parameter = new Parameter(indexString, formatValue(param, hasTaint));
this.parameterValues.add(parameter);
}
Expand All @@ -247,7 +247,7 @@ public void setReturnValue(Object ret, boolean hasTaint) {
private String formatValue(Object val, boolean hasTaint) {
String str = obj2String(val);
return "[" + StringUtils.normalize(str, MAX_VALUE_LENGTH) + "]"
+ (hasTaint ? "*" : "") + String.valueOf(str.length());
+ (hasTaint ? "*" : "") + str.length();
}

public Set<Long> getSourceHashes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ public class PropertyUtils {
private String iastDumpPath;
private Long heartBeatInterval = -1L;
private String serverUrl;
private String serverMode;
private String proxyEnableStatus;
private String proxyHost;
private int proxyPort = -1;
private String debugFlag;
private Integer responseLength;
private String policyPath;
private static List<String> disabledFeatureList;
Expand Down Expand Up @@ -183,13 +181,6 @@ public int getProxyPort() {
return proxyPort;
}

private String getDebugFlag() {
if (debugFlag == null) {
debugFlag = System.getProperty(PropertyConstant.PROPERTY_DEBUG, "false");
}
return debugFlag;
}

public Integer getResponseLength() {
if (responseLength == null) {
responseLength = Integer.parseInt(System.getProperty(PropertyConstant.PROPERTY_RESPONSE_LENGTH,
Expand Down

0 comments on commit f065631

Please sign in to comment.