Versions Compared

Key

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

...

This compliant solution sanitizes the user name input before logging it. Refer to MSC39-J. Sanitize before processing or storing user input for more details on input sanitization.

Code Block
bgColor#ccccff
String username = getUserName();
sanitize(username);
logger.severe("Invalid username:" + username);

...