What is Buffer overflow?
Writing more data into a region such as an array (a buffer) than it can hold, corrupting the adjacent memory. In C it easily happens with functions that do not know the size of the destination, such as strcpy and gets, or with loops that use indices without checking the range, and it is undefined behavior. When a buffer on the stack overflows, local variables and the function's return address can be overwritten, which can be exploited by attacks that run arbitrary code through crafted input. It is prevented with functions that take a size and with range checks.
Japanese name: バッファオーバーフロー
Buffer overflow appears in 3 practice questions across 2 topics, including Linkers, Loaders & Executables, C Programming Basics.
Field: C Programming Basics