Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added cross ref to FIO03J

...

Code Block
bgColor#ccccff
public class DoNotIgnore {
  public static void main(String[] args) {
    String original = "insecure";
    original = original.replace( 'i', '9' );
    System.out.println (original);
  }
}

Yet another source of coding bugs caused by ignoring return values is detailed in FIO03-J. Keep track of bytes read and account for character encoding while reading data.

Risk Assessment

Ignoring method return values may lead to erroneous computation which, in turn, may lead to security risks.

...