fix: address review findings — receive_delta_file STATUS_ERROR on early returns
CI / lint (pull_request) Successful in 7s
CI / sanitizers (address) (pull_request) Successful in 16s
CI / sanitizers (undefined) (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 11s
CI / fuzz-build (pull_request) Successful in 12s
CI / valgrind (pull_request) Successful in 12s
CI / build-and-test (pull_request) Successful in 54s
CI / lint (pull_request) Successful in 7s
CI / sanitizers (address) (pull_request) Successful in 16s
CI / sanitizers (undefined) (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 11s
CI / fuzz-build (pull_request) Successful in 12s
CI / valgrind (pull_request) Successful in 12s
CI / build-and-test (pull_request) Successful in 54s
This commit is contained in:
+5
-1
@@ -162,17 +162,21 @@ static void* old_data_from_path(const char* full_path, unsigned long long old_si
|
|||||||
|
|
||||||
static File* receive_delta_file(int fd, const Config* config, const char* check_path,
|
static File* receive_delta_file(int fd, const Config* config, const char* check_path,
|
||||||
void* old_data, unsigned long long old_size) {
|
void* old_data, unsigned long long old_size) {
|
||||||
if (!old_data)
|
if (!old_data) {
|
||||||
|
send_status(fd, STATUS_ERROR);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
DeltaSignature* sig = delta_signature_create(old_data, old_size, config->delta_block_size);
|
DeltaSignature* sig = delta_signature_create(old_data, old_size, config->delta_block_size);
|
||||||
if (!sig) {
|
if (!sig) {
|
||||||
|
send_status(fd, STATUS_ERROR);
|
||||||
free(old_data);
|
free(old_data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Data* sig_data = delta_signature_serialize(sig);
|
Data* sig_data = delta_signature_serialize(sig);
|
||||||
if (!sig_data) {
|
if (!sig_data) {
|
||||||
|
send_status(fd, STATUS_ERROR);
|
||||||
delta_signature_destroy(sig);
|
delta_signature_destroy(sig);
|
||||||
free(old_data);
|
free(old_data);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user