Master the hardest part of C: memory management. This is where the real cybersecurity and system-level skill starts.
- Stack frames and how locals sit in them
- Stack overflow from an oversized local
- Heap allocation basics
- Heap vs stack vs BSS vs data
- Full memory layout of a running process
-
malloc -
free -
realloc -
calloc - Out-of-bounds writes and what they corrupt
malloc-scalar-array.c and free-scalar-list.c have no main.
free-scalar-list-driver.c drives the second one, and make links the pair
automatically because the driver includes free-scalar-list.h.
- void pointers
- Pointer aliasing
- Function pointers (advanced)
- Flexible array members
- Linked lists
- Managing dynamic arrays
- Dynamic strings
- Dynamic structs
- Implement a dynamic array (like C++ vector)
- Implement a dynamic string
- Implement singly and doubly linked lists
- Build a small heap-allocated JSON parser
- Create a memory leak, then find it with valgrind
- Bonus: write a custom allocator