Why electric fence/Valgrind is unable to catch this buffer-overflow issue?

前端 未结 5 2046
忘掉有多难
忘掉有多难 2021-02-10 16:11

I have created a buggy program - buggy.c - this is a buffer-overflow scenario for buffer t. You can see that I am writing more than 5 indexes. It works fine. It never throws me

5条回答
  •  感动是毒
    2021-02-10 16:40

    Running valgrind --tool=exp-sgcheck ./buggy.out and it should be able to detect that you have buffer overrun within the local variable t[5]

提交回复
热议问题