An area of memory where data is stored until the computer is ready to accept it Example: Keyboard buffer When you're tapping keys and things don't work, the keys you were entering were going into the keyboard buffer Example: Printer buffer Buffer overflow: programming problem where space that was allocated for buffering has been overrun ![](https://www.youtube.com/watch?v=AD-iXWANggo) Writing more data to array than its capacity, the overflow corrupts important data can be overwritten. (A buffer is an array ) ![[Screenshot 2024-08-08 at 6.10.00 AM.png]] Solution: **Runtime bounds checking** + Code checks if array has enough room to fit new number + Makes it impossible to have buffer overflow: Python, Java + Performance overflow for the code we're running when we insert element into array: C/C++ Software complexity has outpaced our ability to find bugs. Buffers are put into a stack. User-controlled buffer overflow when user takes input, we can overewrite with address of return functions. ![[Screenshot 2024-08-08 at 6.35.57 AM.png]]