public Process exec(String command, String[] envp) public Process exec(String command, String[] envp, File dir) public Process exec(String[] cmdarray) public Process exec(String[] cmdarray, String[] envp) public Process exec(String[] cmdarray, String[] envp, File dir) System.exec(String str) 参考:Java OS 命令注⼊学习笔记 43
if (b == null) { throw new NullPointerException(); } if (off < 0 || len < 0 || off + len > b.length) { throw new ArrayIndexOutOfBoundsException(); } crc = updateBytes(crc, b, off, len); } 以上示例中,判断语句 offset + len > b.length 可能导致 offset + len 过⼤⽽溢出,从⽽不满⾜该条件,继续往下正常执⾏,可 能导致访问⾮法内存。将其改为 off > b.length – len 有效避免了整数 溢出问题。 47