Skip to content

Commit

Permalink
Statistics file name sanitizing
Browse files Browse the repository at this point in the history
  • Loading branch information
akaryakina committed Jun 11, 2021
1 parent ae0f35d commit ba3030c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/fortify/plugin/jenkins/FPRSummary.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.thoughtworks.xstream.XStream;

import hudson.FilePath;
import hudson.Util;
import hudson.XmlFile;
import hudson.util.XStream2;

Expand Down Expand Up @@ -53,7 +54,9 @@ private String buildFilename(String appName, String appVersion) {
filename += "-" + appVersion;
}
filename += FILE_EXTENSION;
return filename;
//both appName and appVersion come from user input, so we must sanitize
String sanitizedFilename = Util.rawEncode(filename);
return sanitizedFilename;
}

public void load(File parent, String appName, String appVersion) throws IOException {
Expand Down

0 comments on commit ba3030c

Please # to comment.