Versions Compared

Key

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

...

Code Block
bgColor#ccccff
class ReadNames {
  public static final int fileSizeLimit = 1000000;

  public ReadNames(String filename) throws IOException {
    iflong size = (Files.size( Paths.get( filename));
    if (size > fileSizeLimit) {
      throw new IOException("File too large");
    } else if (size == 0L) {
      throw new IOException("File size cannot be determined, possibly too large");
    }
    this.input = new FileReader(filename);
    this.reader = new BufferedReader(input);
  }

  // ...other methods
}

...

CERT C Secure Coding Standard

MEM11-C. Do not assume infinite heap space

CERT C++ Secure Coding Standard

MEM12-CPP. Do not assume infinite heap space

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="cd8d4d127d0d0c78-f7756357-4de84543-97c090c9-588e4dc3f5cf7e88be59f405"><ac:plain-text-body><![CDATA[

[ISO/IEC TR 24772:2010

http://www.aitcnet.org/isai/]

Resource Exhaustion [XZP]

]]></ac:plain-text-body></ac:structured-macro>

MITRE CWE

CWE-400. Uncontrolled resource consumption ("resource exhaustion")

 

CWE-770. Allocation of resources without limits or throttling

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="95dd982be574af10-cbdb039e-453c426f-bdefae75-b9b1ced4f6c03f6d167421b3"><ac:plain-text-body><![CDATA[

[[API 2006

AA. References#API 06]]

Class ObjectInputStream and ObjectOutputStream

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="587502ee956e7074-1060a6a3-440e42d5-9093b46b-2f4bf30f839a5235c144af3a"><ac:plain-text-body><![CDATA[

[[Java 2006

AA. References#Java 06]]

[java – The Java application launcher

http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html], Syntax for increasing the heap size

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="4e91a33103845670-5698cef5-4e934497-875ba465-c9fa45baebf78c0e18aab0b1"><ac:plain-text-body><![CDATA[

[[SDN 2008

AA. References#SDN 08]]

[Serialization FAQ

http://java.sun.com/javase/technologies/core/basic/serializationFAQ.jsp]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a198f1cd67e3a9c9-70d5b7e1-47494b33-8966842d-5db0588dcebc9aae2214c519"><ac:plain-text-body><![CDATA[

[[Sun 2003

AA. References#Sun 03]]

Chapter 5, Tuning the Java Runtime System, [Tuning the Java Heap

http://docs.sun.com/source/817-2180-10/pt_chap5.html#wp57027]

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="a082f9235e4befd8-2b8dffb4-4ab640b4-8f7e863d-86f72db1f2d9c1eb8bfee3c0"><ac:plain-text-body><![CDATA[

[[Sun 2006

AA. References#Sun 06]]

[Garbage Collection Ergonomics

http://java.sun.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html ], Default values for the Initial and Maximum Heap Size

]]></ac:plain-text-body></ac:structured-macro>

...