r/eli5_programming • u/Ced3j • Sep 21 '24
Question ELI5 - What is buffer overflow?
What is buffer overflow guys?
7
Upvotes
r/eli5_programming • u/Ced3j • Sep 21 '24
What is buffer overflow guys?
View all comments
Show parent comment
4
u/teachMe Sep 22 '24
The consequences depend on what kind of programming language and hardware you are working with. One possibility is that you end up writing data on top of some other data. Your new book/data is now intact, but when someone goes to read the old book/data, it is corrupted from their point of view. Then that corrupted data may have consequences every other place it's used.
A malicious person who happens to notice that you aren't careful with checking for the right amount of space may push a bunch of books onto the shelf, and purposely bump books off, inserting their own books with "bad" instructions in them. Instead of cookbooks with recipes, the new books have instructions on how to give them control of the house. One of their books is given to a reader, and the reader follows the malicious instructions.