DEV Community

Discussion on: Explain "Memory Safe Programming Languages" Like I'm Five Please

Collapse
 
pjnpjn2 profile image
p novak

my understanding of this issue is that in writing code in C and C++ for ex. the coder defines memory addresses and buffer sizes where data is held or work is performed. buffer overflow occurs when a coder has not accurately delineated the buffer or memory size or addresses. since the space is contiguous, a hacker can push more code into the ill defined space causing it to 'spill over' into the next address, thereby feeding false data into the processing. think of a house with many rooms and multiple doors to each room. good code opens the most efficient door pathway for a person to get anywhere in the house (ie: processing), AND closes each door as it passes thru to prevent unauthorized ppl from passing. A buffer overflow or memory leak, is a door left open and an unauthorized ppl enters.

Collapse
 
figgsboson profile image
Henry Zhang

so like if tetris blocks were sentient beings and they hired tetroidian contractors to build their houses with perfectly shaped doors to prevent the pacman ghosts to squeeze through the doors.

idk, I just picture blocks for all this 😅