Skip to content

Commit

Permalink
Changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
smashery committed Oct 15, 2024
1 parent 26eddbb commit 26d0aa3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ public int execute(Meterpreter meterpreter, TLVPacket request, TLVPacket respons
// 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();
Expand Down

0 comments on commit 26d0aa3

Please sign in to comment.