필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Mark all pointers that "may be outside bounds" as a finding?

조회 수: 1 (최근 30일)
Ma Ka
Ma Ka 2016년 12월 20일
댓글: Ma Ka 2016년 12월 20일
I have a lot of "illegally dereferenced pointer" findings. They tend to be hard to track down since the pointer may be dereferenced long after it is defined. Is there a way to make the Code Prover issue a finding (probably going to be an orange one) as soon as it sees that a pointer may be out of bounds? Here is some code to illustrate the issue:
static volatile int x;
int array[10] = {0};
int idx = x % 20;
int *p2 = &(array[idx]); /* hoovering over p2, Code Prover states that p2 may be out of bounds; there are no orange or red findings in this line, however */
/* here be lots of code, function calls,... */
int a = *p2; /* Orange finding: illegally dereferenced pointer */
  댓글 수: 1
Ma Ka
Ma Ka 2016년 12월 20일
Can anyone let me know why this question was closed so that I can improve it?

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by