Versions Compared

Key

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

...

SEI CERT C++ Coding Standard

OOP08-CPP. Do not return references to private data.

MITRE CWE

CWE-375, Returning a mutable object Mutable Object to an untrusted callerUntrusted Caller

Bibliography

[API 2006]

Method clone()

[Bloch 2008]

Item 39, "Make Defensive Copies When Needed"

[Goetz 2006]

Section 3.2, "Publication and Escape: Allowing Internal Mutable State to Escape"

[Gong 2003]

Section 9.4, "Private Object State and Object Immutability"

[Haggar 2000]

Practical Java Praxis 64. Use clone for immutable objects when passing or receiving object references to mutable objects

[Security 2006]

 

...