1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-13 03:48:26 -06:00
* Update LZMA to latest

* Update Libzip

Libzip updated to latest.
This commit is contained in:
DLL125
2023-07-17 14:11:12 +02:00
committed by GitHub
parent 6267b91931
commit 65765798d8
77 changed files with 1381 additions and 546 deletions

View File

@@ -31,8 +31,10 @@
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <zlib.h>
#include "zipint.h"
@@ -46,7 +48,7 @@ _zip_read(zip_source_t *src, zip_uint8_t *b, zip_uint64_t length, zip_error_t *e
}
if ((n = zip_source_read(src, b, length)) < 0) {
_zip_error_set_from_source(error, src);
zip_error_set_from_source(error, src);
return -1;
}
@@ -81,7 +83,7 @@ _zip_read_data(zip_buffer_t *buffer, zip_source_t *src, size_t length, bool nulp
free(r);
return NULL;
}
memcpy(r, data, length);
(void)memcpy_s(r, length, data, length);
}
else {
if (_zip_read(src, r, length, error) < 0) {
@@ -122,7 +124,7 @@ _zip_write(zip_t *za, const void *data, zip_uint64_t length) {
zip_int64_t n;
if ((n = zip_source_write(za->src, data, length)) < 0) {
_zip_error_set_from_source(&za->error, za->src);
zip_error_set_from_source(&za->error, za->src);
return -1;
}
if ((zip_uint64_t)n != length) {
@@ -130,5 +132,15 @@ _zip_write(zip_t *za, const void *data, zip_uint64_t length) {
return -1;
}
if (za->write_crc != NULL) {
zip_uint64_t position = 0;
while (position < length) {
zip_uint64_t nn = ZIP_MIN(UINT_MAX, length - position);
*za->write_crc = (zip_uint32_t)crc32(*za->write_crc, (const Bytef *)data + position, (uInt)nn);
position += nn;
}
}
return 0;
}