-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// PARAM: --set ana.activated[+] memOutOfBounds --enable ana.int.interval --disable warn.info | ||
// TODO: The "--disable warn.info" part is a temporary fix and needs to be removed once the MacOS CI job is fixed | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
int main(int argc, char const *argv[]) { | ||
int *a = malloc(10 * sizeof(int)); //Size is 40 bytes, assuming a 4-byte int | ||
int *b = malloc(15 * sizeof(int)); //Size is 60 bytes, assuming a 4-byte int | ||
|
||
memset(a, 0, 40); //NOWARN | ||
memcpy(a, b, 40); //NOWARN | ||
|
||
a += 3; | ||
|
||
memset(a, 0, 40); //WARN | ||
memcpy(a, b, 40); //WARN | ||
|
||
memset(a, 0, 37); //NOWARN | ||
memcpy(a, b, 37); //NOWARN | ||
} |