Buffer underrun

In computing, buffer underrun or buffer underflow is a state occurring when a buffer used for communicating between two devices or processes is fed with data at a lower speed than the data is being read from it. This requires the program reading from the buffer to pause its processing while the buffer refills. Having to deal with such situations can cause undesired and sometimes serious side effects because the data being buffered is often not suited for stop-start access of this kind.

In terms of concurrent programming, a buffer underrun can be considered a form of resource starvation.

The term as defined above is distinct from buffer overflow, a condition where a portion of memory forms a buffer of a fixed size yet is filled with more than that amount of data, thus overwriting memory locations outside of the allocated chunk. However, buffer underrun and underflow are also sometimes used to mean buffer underwrite, where a program is tricked into writing data into memory locations before the beginning of the buffer, overriding potential data there such as permission bits.[1]

  1. ^ "CWE-124: Buffer Underwrite ('Buffer Underflow')". CWE.