1
mirror of https://github.com/rapid7/metasploit-payloads synced 2025-03-30 22:19:17 +02:00

Changes from code review

This commit is contained in:
Ashley Donaldson 2024-10-15 22:11:02 +11:00
parent 26eddbb7a3
commit 26d0aa3e8d

@ -68,8 +68,12 @@ public class stdapi_sys_process_execute implements Command {
// On Windows, Java quote-escapes _some_ arguments (like those with spaces), but doesn't deal correctly with some
// edge cases; e.g. empty strings, strings that already have quotes.
protected String escapeArg(String arg) {
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
if (arg == "") {
if (arg == null) {
return null;
}
String osName = System.getProperty("os.name");
if (osName != null && osName.toLowerCase().contains("windows")) {
if (arg.equals("")) {
return "\"\"";
} else {
StringBuilder sb = new StringBuilder();