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

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

    Citing from valgrind quick start guide: "For example, it can't detect out-of-range reads or writes to arrays that are allocated statically or on the stack."

提交回复
热议问题