From a817e1555a755224cacc1cbdeeaefb6a1de606f0 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 24 Apr 2024 17:09:08 +0200 Subject: Fix some overlap mismatch This was caught by the following test: ``` int main(void) { char c[32]; memcpy(c, c + 16, 16); } ``` Reported-by: q66 --- tests/Makefile | 1 + tests/test_issue57.c | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/test_issue57.c (limited to 'tests') diff --git a/tests/Makefile b/tests/Makefile index 8faf11a..81a1943 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -42,6 +42,7 @@ RUNTIME_TARGETS= \ test_gethostname_static \ test_getlogin_r_dynamic \ test_getlogin_r_static \ + test_issue57 \ test_mbsrtowcs_dynamic \ test_mbsrtowcs_static \ test_mbstowcs_dynamic \ diff --git a/tests/test_issue57.c b/tests/test_issue57.c new file mode 100644 index 0000000..ee9c38e --- /dev/null +++ b/tests/test_issue57.c @@ -0,0 +1,11 @@ +#include "common.h" + +#include + +int main(int argc, char** argv) { + char buffer[32]; + memcpy(buffer , buffer + 16, 16); + puts(buffer); + + return ret; +} -- cgit v1.3