You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This query finds pointer dereferences that use a pointer returned from a function which may return NULL. Always
check your pointers for NULL-ness before dereferencing them. Dereferencing a null pointer and attempting to
modify its contents can lead to anything from a segmentation fault to corruption of important system data
(for example, the interrupt table in some architectures).
</p>
</overview>
<recommendation>
<p>
Add a null check before dereferencing the pointer, or modify the function so that it always returns a non-null value.
</p>
</recommendation>
<example>
<p>In this example, the function is not protected from dereferencing a null pointer. It should be updated to ensure that
this cannot happen.
</p>
<samplesrc="MissingNullTest.cpp" />
</example>
<references>
<li>SEI CERT C Coding Standard: <ahref="https://wiki.sei.cmu.edu/confluence/display/c/EXP34-C.+Do+not+dereference+null+pointers">EXP34-C. Do not dereference null pointers</a>.</li>