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

前端 未结 5 2075
忘掉有多难
忘掉有多难 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:36

    Valgrind and EF detect errors in dynamically-allocated memory. Your array is not dynamically-allocated.

提交回复
热议问题