From 237bf823196cf70e4d3c75fe365aa75e1b3f483e Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 11 Oct 2025 14:07:02 +0200 Subject: [PATCH] fix alloction issue mock --- tests/kds_s2000w_client_mock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/kds_s2000w_client_mock.c b/tests/kds_s2000w_client_mock.c index 23cf269..2ee325c 100644 --- a/tests/kds_s2000w_client_mock.c +++ b/tests/kds_s2000w_client_mock.c @@ -106,7 +106,9 @@ char* __wrap_sanei_config_get_paths(void) size_t size = strlen(str) + 1; char* cpystr = malloc(size); - memcpy(cpystr, str, size); + if (cpystr == NULL) + return NULL; + cpystr = strncpy(cpystr, str, size); return cpystr; } \ No newline at end of file -- 2.47.3