Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When Invocation of System.exit() is invoked, terminates the JVM, consequently terminating all programs and threads running on the JVM terminatethereon. This can result in denial-of-service attacks, for . For example, a web server can stop servicing users upon encountering an untimely call to System.exit() that is embedded in some JSP code can cause a web server to terminate, preventing further service for users. Programs must prevent both inadvertent and malicious calls to System.exit(). Additionally, programs should perform necessary clean-up actions when forcibly terminated (via ctrl + c or the kill command, for example).

Noncompliant Code Example

asdf
This noncompliant code example calls System.exit() to forcefully shutdown the JVM and terminate the running process. No security manager checks have been installed to check whether the program has sufficient permissions to exit.

...