Skip to content

Commit

Permalink
Introduced protections against system command injection
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot[bot] authored Jul 11, 2024
1 parent b335cb7 commit 72b9066
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/mindustry/net/BeControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import arc.func.*;
import arc.util.*;
import arc.util.serialization.*;
import io.github.pixee.security.SystemCommand;
import mindustry.*;
import mindustry.core.*;
import mindustry.gen.*;
Expand Down Expand Up @@ -107,10 +108,9 @@ public void showUpdateDialog(){
BaseDialog dialog = new BaseDialog("@be.updating");
download(updateUrl, file, i -> length[0] = i, v -> progress[0] = v, () -> cancel[0], () -> {
try{
Runtime.getRuntime().exec(OS.isMac ?
SystemCommand.runCommand(Runtime.getRuntime(), OS.isMac ?
new String[]{javaPath, "-XstartOnFirstThread", "-DlastBuild=" + Version.build, "-Dberestart", "-Dbecopy=" + fileDest.absolutePath(), "-jar", file.absolutePath()} :
new String[]{javaPath, "-DlastBuild=" + Version.build, "-Dberestart", "-Dbecopy=" + fileDest.absolutePath(), "-jar", file.absolutePath()}
);
new String[]{javaPath, "-DlastBuild=" + Version.build, "-Dberestart", "-Dbecopy=" + fileDest.absolutePath(), "-jar", file.absolutePath()});
System.exit(0);
}catch(IOException e){
ui.showException(e);
Expand Down

0 comments on commit 72b9066

Please sign in to comment.