fix: memory safety — malloc NULL checks, strcpy→memcpy
CI / lint (pull_request) Failing after 2s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (undefined) (pull_request) Has been skipped
CI / fuzz-build (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / valgrind (pull_request) Has been skipped

This commit is contained in:
2026-07-20 21:24:44 +02:00
parent 8234677276
commit 9a214c46e2
4 changed files with 4 additions and 2 deletions
+1
View File
@@ -54,6 +54,7 @@ FileMetadata* metadata_from_buf(char** buf) {
if (!present)
return NULL;
FileMetadata* m = malloc(sizeof(FileMetadata));
if (m == NULL) return NULL;
int32_t mode;
memcpy(&mode, *buf, sizeof(mode));
*buf += sizeof(mode);