fix: memory safety — malloc NULL checks, strcpy→memcpy, str_dup NULL check, remove unused include
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:25:23 +02:00
parent 224e7e8599
commit 3ffc5c5236
6 changed files with 10 additions and 4 deletions
+1
View File
@@ -41,6 +41,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);