From 140cffbe84a08669d67c3257258d2bb70ff29c3b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Fri, 8 Mar 2024 16:07:57 +0100 Subject: Add some NULL-pointers checks See: - https://www.imperialviolet.org/2016/06/26/nonnull.html - https://davidben.net/2024/01/15/empty-slices.html --- tests/test_memmove_null_src.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_memmove_null_src.c (limited to 'tests/test_memmove_null_src.c') diff --git a/tests/test_memmove_null_src.c b/tests/test_memmove_null_src.c new file mode 100644 index 0000000..e03b97a --- /dev/null +++ b/tests/test_memmove_null_src.c @@ -0,0 +1,16 @@ +#include "common.h" + +#include + +int main(int argc, char** argv) { +#ifndef __GNUC__ + char buffer[12] = {0}; + + CHK_FAIL_START + memmove(NULL, buffer, 0); + CHK_FAIL_END + + puts(buffer); +#endif + return ret; +} -- cgit v1.3