What is a buffer overflow and how do I cause one?

前端 未结 12 1939
盖世英雄少女心
盖世英雄少女心 2020-11-30 00:43

I have heard about a buffer overflow and I would like to know how to cause one.

Can someone show me a small buffer overflow example? New(And what they are used for?)

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-30 01:18

    In addition to what has already been said, keep in mind that you'r program may or may not "crash" when a buffer overflow occurs. It should crash, and you should hope it does - but if the buffer overflow "overflows" into another address that your application has also allocated - your application may appear to operate normally for a longer period of time.

    If you are using a later edition of Microsoft Visual Studio - I would suggest using the new secure counterparts in the stdlib, such as sprintf_s insted of sprintf, ect...

提交回复
热议问题