mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
23 lines
789 B
HTML
23 lines
789 B
HTML
<html>
|
|
<body>
|
|
Reports calls to <code>java.lang.Runtime.exec()</code> which take a dynamically-constructed string as the command to execute.
|
|
<p>
|
|
Constructed execution strings are a common source of security breaches.
|
|
By default, this inspection ignores compile-time constants.
|
|
</p>
|
|
<p><b>Example:</b></p>
|
|
<pre><code>
|
|
String i = getUserInput();
|
|
Runtime runtime = Runtime.getRuntime();
|
|
runtime.exec("foo" + i); // reports warning
|
|
</code></pre>
|
|
<!-- tooltip end -->
|
|
<p>
|
|
Use the inspection settings to consider any <code>static</code> <code>final</code> fields as constant.
|
|
Be careful, because strings like the following will be ignored when the option is enabled:
|
|
<pre><code>
|
|
static final String COMMAND = "ping " + getDomainFromUserInput() + "'";
|
|
</code></pre>
|
|
<p>
|
|
</body>
|
|
</html> |