fortify-headers

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

commit 37d8733dc522c44f9cdb9247f4a59e23bf0a9659
parent 1ace027335c9ca0ae400958aded936d04505ec86
Author: jvoisin <julien.voisin@dustri.org>
Date:   Tue, 30 May 2023 20:53:31 +0200

Add a test for getcwd

Diffstat:
Mtests/Makefile | 1+
Atests/test_getcwd.c | 14++++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile @@ -15,6 +15,7 @@ TARGETS=test_memcpy_static_write \ test_strcat_static_write \ test_strcpy_overwrite_over \ test_strcpy_overwrite_under\ + test_getcwd \ .SILENT: diff --git a/tests/test_getcwd.c b/tests/test_getcwd.c @@ -0,0 +1,14 @@ +#include "common.h" + +#include <string.h> + +int main(int argc, char** argv) { + char buffer[12] = {0}; + + CHK_FAIL_START + getcwd(buffer, 14); + CHK_FAIL_END + + puts(buffer); + return ret; +}