Author: markt Date: Thu Jul 31 11:45:54 2014 New Revision: 1614864 URL: http://svn.apache.org/r1614864 Log: Use safer exec() construct. It shouldn't matter since this is a test but better to do things the 'right' way.
Modified: tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java Modified: tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java?rev=1614864&r1=1614863&r2=1614864&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java (original) +++ tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java Thu Jul 31 11:45:54 2014 @@ -17,6 +17,7 @@ package org.apache.tomcat.util.net.jsse.openssl; import java.io.InputStream; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; @@ -177,12 +178,13 @@ public class TestCipher { if (openSSLPath == null || openSSLPath.length() == 0) { openSSLPath = "openssl"; } - StringBuilder cmd = new StringBuilder(openSSLPath + " ciphers"); + List<String> cmd = new ArrayList<>(); + cmd.add(openSSLPath); + cmd.add("ciphers"); if (specification != null) { - cmd.append(' '); - cmd.append(specification); + cmd.add(specification); } - Process process = Runtime.getRuntime().exec(cmd.toString()); + Process process = Runtime.getRuntime().exec(cmd.toArray(new String[cmd.size()])); InputStream stderr = process.getErrorStream(); InputStream stdout = process.getInputStream(); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org