Static Analysis Problem Type Reference
A null pointer was dereferenced.
This error indicates that at least one possible flow of execution connects a null assignment to a pointer with a dereference of that pointer (or another pointer assigned from the null pointer). The GUI may present one problem set that combines several null dereference errors that share a common null assignment.
|
ID |
Code Location |
Description |
|---|---|---|
|
1 |
Memory write |
The place where the pointer was set to zero |
|
2-N |
Null dereference |
The place where the null pointer was dereferenced |
#include <stdio.h>
int main(int argc, char **argv)
{
int *p;
// can't do this
p = 0;
printf("contents of location 0 are %d\n", *p);
return 0;
}