Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
langc
#include <stddef.h>
 
enum { TABLESIZE = 100 };

static int table[TABLESIZE];

int *f(size_t index) {
  if (index < TABLESIZE) {
    return table + index;
  }
  return NULL;
}

Anchor
#Dereferencing Dereferencing Past the End Pointer#Dereferencing
Dereferencing Past the End Pointer

Noncompliant Code Example (Dereferencing Past-the-End Pointer)

...