From 01b68b99c656c455c6ebaad3a67de65d51e1c269 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 11 Jul 2021 16:42:19 +0200 Subject: [PATCH] posix.cfg: Added overlapping data check for stpcpy(). --- cfg/posix.cfg | 1 + test/cfg/posix.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/cfg/posix.cfg b/cfg/posix.cfg index afffdd2fa..1da97e5ad 100644 --- a/cfg/posix.cfg +++ b/cfg/posix.cfg @@ -3889,6 +3889,7 @@ The function 'mktemp' is considered to be dangerous due to race conditions and s false + diff --git a/test/cfg/posix.c b/test/cfg/posix.c index ac7e4c6ea..bae5685f1 100644 --- a/test/cfg/posix.c +++ b/test/cfg/posix.c @@ -29,6 +29,14 @@ #include #include +char * overlappingWriteFunction_stpcpy(char *src, char *dest) +{ + // No warning shall be shown: + (void) stpcpy(dest, src); + // cppcheck-suppress overlappingWriteFunction + return stpcpy(src, src); +} + void overlappingWriteFunction_bcopy(char *buf, const size_t count) { // No warning shall be shown: