mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
SyncEngine: Fix a crash in csync_vio_file_stat_copy #3051
In some cryptic cases where the getetag property wasn't returned by the server, we might be trying to c_strdup a null pointer in csync_vio_file_stat_copy. At least avoid crashing in this case by looking for CSYNC_VIO_FILE_STAT_FIELDS_ETAG, like csync_vio_file_stat_destroy does.
This commit is contained in:
parent
4a890eae38
commit
d475628c70
@ -30,7 +30,9 @@ csync_vio_file_stat_t *csync_vio_file_stat_new(void) {
|
||||
csync_vio_file_stat_t* csync_vio_file_stat_copy(csync_vio_file_stat_t *file_stat) {
|
||||
csync_vio_file_stat_t *file_stat_cpy = csync_vio_file_stat_new();
|
||||
memcpy(file_stat_cpy, file_stat, sizeof(csync_vio_file_stat_t));
|
||||
file_stat_cpy->etag = c_strdup(file_stat_cpy->etag);
|
||||
if (file_stat_cpy->fields & CSYNC_VIO_FILE_STAT_FIELDS_ETAG) {
|
||||
file_stat_cpy->etag = c_strdup(file_stat_cpy->etag);
|
||||
}
|
||||
if (file_stat_cpy->directDownloadCookies) {
|
||||
file_stat_cpy->directDownloadCookies = c_strdup(file_stat_cpy->directDownloadCookies);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user