Skip to content

Commit

Permalink
Correct test 77/07 to warn for src OOB access in memcpy as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstanb committed Oct 4, 2023
1 parent 136bec0 commit 3a2fe3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/regression/77-mem-oob/07-memcpy-oob.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ int main(int argc, char const *argv[]) {
memcpy(a, b, 40); //WARN
memcpy(a, b, sizeof(a)); //WARN

memcpy(b, a, 60); //NOWARN
memcpy(b, a, 60); //WARN
b += 1;
memcpy(b, a, 60); //WARN


s *s_ptr = malloc(sizeof(s));
memcpy(s_ptr, a, sizeof(s)); //NOWARN
memcpy(s_ptr, a, sizeof(s)); //WARN
memcpy(s_ptr->a, 0, sizeof(s)); //WARN
memcpy(s_ptr->b, 0, sizeof(s)); //WARN

Expand Down

0 comments on commit 3a2fe3f

Please sign in to comment.