fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit 3375426d8c18f43f58ab83c261735b04562828ae
parent a817e1555a755224cacc1cbdeeaefb6a1de606f0
Author: jvoisin <julien.voisin@dustri.org>
Date:   Wed, 24 Apr 2024 18:36:10 +0200

Add a test

Diffstat:
Mtests/Makefile | 1+
Atests/test_issue57_strcpy.c | 11+++++++++++
2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile @@ -43,6 +43,7 @@ RUNTIME_TARGETS= \ test_getlogin_r_dynamic \ test_getlogin_r_static \ test_issue57 \ + test_issue57_strcpy \ test_mbsrtowcs_dynamic \ test_mbsrtowcs_static \ test_mbstowcs_dynamic \ diff --git a/tests/test_issue57_strcpy.c b/tests/test_issue57_strcpy.c @@ -0,0 +1,11 @@ +#include "common.h" + +#include <string.h> + +int main(int argc, char** argv) { + char buffer[32] ={'a', 'b', 'c', 0}; + strcpy(buffer , buffer + 16); + puts(buffer); + + return ret; +}