Buffer overflow
When a program writes more data into a memory area (buffer) than it can hold, overwriting nearby memory. This can crash the program or let an attacker run their own code.
Understanding Buffer overflow in ACARA Digital Technologies Years 9–10
What it does: A segmentation fault is a common crash message when a program touches memory it should not, such as after an overflow. The long run of filler fills the buffer and spills over, and the attacker's code lands in memory where the program may run it. The extra 12 characters spill into nearby memory and overwrite it. That is a buffer overflow. Input validation stops oversized data from ever being written into the buffer. The text is longer than the 8-character buffer, and strcpy does not check the length, so this is a buffer overflow.
Common mistakes: name only holds 8 bytes, but this copies up to 20 bytes into it. The extra bytes overflow into nearby memory. The copy length should match the buffer size: strncpy(name, input, 8);. The word has 6 letters but the buffer only has 3 slots, so the extra letters would overwrite nearby memory. The buffer needs to be big enough: array of 6 slots.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 782–809) and word search (Modules 743–809).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
buffer overflowFill in the Blanks
Spot the Error
Student with a class code? Join your class →