Merge remaining 4 PRs: memory safety, refactoring, test coverage, integration cleanup #93
+2
-1
@@ -14,7 +14,8 @@ Config* config_create(char* version, char* send_directory, char* receive_directo
|
|||||||
bool use_sendfile, unsigned long long chunk_size) {
|
bool use_sendfile, unsigned long long chunk_size) {
|
||||||
|
|
||||||
Config* config = malloc(sizeof(Config));
|
Config* config = malloc(sizeof(Config));
|
||||||
if (config == NULL) return NULL;
|
if (config == NULL)
|
||||||
|
return NULL;
|
||||||
config->version = version;
|
config->version = version;
|
||||||
config->send_directory = send_directory;
|
config->send_directory = send_directory;
|
||||||
config->receive_root_directory = receive_directory;
|
config->receive_root_directory = receive_directory;
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ FileMetadata* metadata_from_buf(char** buf) {
|
|||||||
if (!present)
|
if (!present)
|
||||||
return NULL;
|
return NULL;
|
||||||
FileMetadata* m = malloc(sizeof(FileMetadata));
|
FileMetadata* m = malloc(sizeof(FileMetadata));
|
||||||
if (m == NULL) return NULL;
|
if (m == NULL)
|
||||||
|
return NULL;
|
||||||
int32_t mode;
|
int32_t mode;
|
||||||
memcpy(&mode, *buf, sizeof(mode));
|
memcpy(&mode, *buf, sizeof(mode));
|
||||||
*buf += sizeof(mode);
|
*buf += sizeof(mode);
|
||||||
|
|||||||
Reference in New Issue
Block a user