Skip to content

Commit

Permalink
Merge pull request #39 from chen-honggang/dev/crash-fix
Browse files Browse the repository at this point in the history
fix the possible crash in cos_resumable_download_file()
  • Loading branch information
chen-honggang authored Jun 22, 2022
2 parents 95d9cf7 + 0a15a7d commit ddf4b1d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cos_c_sdk/cos_resumable.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,13 @@ void * APR_THREAD_FUNC download_part(apr_thread_t *thd, void *data)

cos_debug_log("download part = %d, start byte = %"APR_INT64_T_FMT", end byte = %"APR_INT64_T_FMT, part_num, download_file->file_pos, download_file->file_last-1);

if (!cos_status_is_ok(s)) {
apr_atomic_inc32(params->failed);
params->result->s = s;
apr_queue_push(params->failed_parts, params->result);
return s;
}

etag = apr_pstrdup(params->options.pool, (char*)apr_table_get(resp_headers, "ETag"));
cos_str_set(&params->result->etag, etag);
params->result->crc64 = resp->crc64;
Expand Down

0 comments on commit ddf4b1d

Please sign in to comment.