VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/libzip/zip_file_replace.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/libzip/zip_file_replace.c')
-rw-r--r--src/Common/libzip/zip_file_replace.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Common/libzip/zip_file_replace.c b/src/Common/libzip/zip_file_replace.c
index 4262d453..ce457ed1 100644
--- a/src/Common/libzip/zip_file_replace.c
+++ b/src/Common/libzip/zip_file_replace.c
@@ -1,8 +1,8 @@
/*
zip_file_replace.c -- replace file via callback function
- Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
+ Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <info@libzip.org>
Redistribution and use in source and binary forms, with or without
@@ -81,10 +81,16 @@ _zip_file_replace(zip_t *za, zip_uint64_t idx, const char *name, zip_source_t *s
za->nentry = za_nentry_prev;
}
return -1;
}
+ /* delete all extra fields - these are usually data that are
+ * strongly coupled with the original data */
+ if (zip_file_extra_field_delete(za, idx, ZIP_EXTRA_FIELD_ALL, ZIP_FL_CENTRAL | ZIP_FL_LOCAL) < 0) {
+ return -1;
+ }
+
/* does not change any name related data, so we can do it here;
* needed for a double add of the same file name */
_zip_unchange_data(za->entry + idx);
if (za->entry[idx].orig != NULL && (za->entry[idx].changes == NULL || (za->entry[idx].changes->changed & ZIP_DIRENT_COMP_METHOD) == 0)) {