]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix alloction issue mock
authorBastian Dehn <hhaalo@arcor.de>
Sat, 11 Oct 2025 12:07:02 +0000 (14:07 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 11 Oct 2025 12:07:02 +0000 (14:07 +0200)
tests/kds_s2000w_client_mock.c

index 23cf269d13ec8db0dd09a33c73ec9d91988dcad9..2ee325c2e2a50eee77884da919f82348183ef6be 100644 (file)
@@ -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