提交 be74b137 编写于 作者: M michaelm

6910590: Application can modify command array, in ProcessBuilder

Summary: clone array returned by List.toArray()
Reviewed-by: chegar, alanb
上级 80f998dc
......@@ -994,6 +994,8 @@ public final class ProcessBuilder
// Must convert to array first -- a malicious user-supplied
// list might try to circumvent the security check.
String[] cmdarray = command.toArray(new String[command.size()]);
cmdarray = cmdarray.clone();
for (String arg : cmdarray)
if (arg == null)
throw new NullPointerException();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册