posix.c: Add test to avoid regression of already fixed ticket #9118 (#1820)

Trac ticket: https://trac.cppcheck.net/ticket/9118
Commit that likely fixed it already:
1b74bca973
This commit is contained in:
Sebastian 2019-05-03 16:35:15 +02:00 committed by GitHub
parent 96a7c19b91
commit b1cb03b560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -21,6 +21,13 @@
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
void validCode()
{
void *ptr;
if (posix_memalign(&ptr, sizeof(void *), sizeof(void *)) == 0)
free(ptr);
}
void bufferAccessOutOfBounds(int fd) void bufferAccessOutOfBounds(int fd)
{ {
char a[5]; char a[5];