Null pointer dereference

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

Observation

Description

1

Memory write

The place the pointer was set to zero

2-N

Null dereference

The place the null pointer was dereferenced

Example


#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;
}
        

Copyright © 2010, Intel Corporation. All rights reserved.