1/13
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Text (Code)
machine instructions, read-only, entire program lifetime
Data
initialized globals/statics (int x = 5; at global scope)
BSS
uninitialized globals/statics, auto-zeroed by OS
Heap
dynamic allocation (malloc/new), grows upward, you manage lifetime
Stack
local vars + function args, grows downward, auto-managed
Dangling Pointer
A pointer that points to memory that has already been freed. Accessing it is undefined behavior and a security risk.
Lost Heap Variable (Memory Leak)
A heap allocation that can no longer be reached — no pointer points to it. Cannot be freed. Accumulates = memory leak.
Array Out of Bounds
Out-of-bounds writes are the root cause of buffer overflow attacks.
Unchecked open()
returns -1 on failure. Must check before using fd.
Unchecked read()
read() returns bytes read. Negative = error. Fewer bytes = partial read.
Invalid len to malloc
If len is negative or too large, conversion to unsigned size_t can cause a huge/incorrect allocation request.
Unchecked malloc()
malloc() returns NULL on failure. Must check before dereferencing.
Missing null terminator
Allocating len bytes for a string but needing len+1 for '\0'.
Missing free()/close()
Not freeing memory or closing file descriptors = resource leaks.