MITRE D3FENDdefensive technique
D3-NPC Null Pointer Checking
- Tactic
- Harden
- Synonyms
- Nil Pointer Checking
Definition
Checking if a pointer is NULL.
How it works
How it Works
Programmatically checking if a pointer is NULL before use.
Considerations
• Pointers should be checked prior to use after they have, or may have been modified.
• Note that it may vary by circumstance whether the caller, or callee is responsible for checking if a pointer is NULL.
• Note: This resource should not be considered a definitive or exhaustive coding guideline.
Related
Child of · MITRE D3FEND (1)
- D3-PV Pointer Validation defensive technique
References
- https://wiki.sei.cmu.edu/confluence/display/c/EXP34-C.+Do+not+dereference+null+pointers SEI CERT C Coding Standard
- https://cwe.mitre.org/data/definitions/476.html CWE-476: NULL Pointer Dereference
- https://wiki.sei.cmu.edu/confluence/display/c/MEM10-C.+Define+and+use+a+pointer+validation+function SEI CERT C Coding Standard