What is the difference between STATUS_STACK_BUFFER_OVERRUN and STATUS_STACK_OVERFLOW?

I just found out that there are STATUS_STACK_BUFFER_OVERRUN and STATUS_STACK_OVERFLOW. What is the difference between these 2? I just found a stack overflow (stack exhaustion), not the same as a stack buffer overflow , but either this does not explain, or I do not understand it. Can you help me?

Relationship Tobias

+6
source share
2 answers

Consider the following stack, which grows in memory down:

+----------------+ | some data | | +----------------+ | growth of stack | 20-byte string | V +----------------+ limit of stack 

Buffer overflows occur when you write 30 bytes for your 20-byte string. This will damage the entries in the stack ("some data").

Stack overflow is when you try to push something else to the stack when it is already full (where "stack limit" is indicated). Stacks are usually limited to a maximum size.

+7
source

Stackoverflow appears when there is no more space in memory to allocate your data, and buffer overrun aka buffer overflow is called when the program redistributes the buffer boundary and writes / overwrites data in an unexpected part of the memory (takes up more memory than expected).

Easy, you can understand this by simply reading the description of stackoverflow tags and buffer overflows .

0
source

Source: https://habr.com/ru/post/927443/


All Articles