You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

A simple, yet affective way to avoid double-free and access-freed-memory vulnerabilities is to set pointers to NULL once they have been freed. The specification of the free function states that calling free on a NULL pointer incurs no action ISO/IEC 9899. Thus, if a pointer is set to NULL after it is freed, the chances of introducing vulnerabilities related to free are eliminated.

References

ISO/IEC 9899-1999 Section 7.20.3.2 The free function

  • No labels