Curriculum
Course: Cyber Security
Login

Curriculum

Cyber Security

Text lesson

Return Pointer

The Return Pointer directs the CPU to the next memory address for executing code. If an attacker controls it, they can dictate the CPU’s actions. For instance, in simple C code, this pointer guides the CPU on which instructions to execute next.

#include <string.h>
void storeName (char *input) {
  char name[12];
  strcpy(name, input);
}

int main (int argc, char **argv) {
  storeName(argv[1]);
  return 0;
}