From: Bastian Dehn Date: Sat, 11 Oct 2025 12:07:02 +0000 (+0200) Subject: fix alloction issue mock X-Git-Tag: v1.1.10^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=237bf823196cf70e4d3c75fe365aa75e1b3f483e;p=sane-kds-s2000w-net.git fix alloction issue mock --- 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