1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2026-01-03 04:18:10 -06:00

Windows: Update libzip to 1.6.1

This commit is contained in:
Mounir IDRASSI
2020-03-09 11:34:21 +01:00
parent 7d110798d2
commit da370af54b
112 changed files with 598 additions and 279 deletions

View File

@@ -1,6 +1,6 @@
/*
zip_source_buffer.c -- create zip data source from buffer
Copyright (C) 1999-2018 Dieter Baron and Thomas Klausner
Copyright (C) 1999-2019 Dieter Baron and Thomas Klausner
This file is part of libzip, a library to manipulate ZIP archives.
The authors can be contacted at <libzip@nih.at>
@@ -93,9 +93,13 @@ ZIP_EXTERN zip_source_t *
zip_source_buffer_create(const void *data, zip_uint64_t len, int freep, zip_error_t *error) {
zip_buffer_fragment_t fragment;
if (data == NULL && len > 0) {
zip_error_set(error, ZIP_ER_INVAL, 0);
return NULL;
if (data == NULL) {
if (len > 0) {
zip_error_set(error, ZIP_ER_INVAL, 0);
return NULL;
}
return zip_source_buffer_fragment_create(NULL, 0, freep, error);
}
fragment.data = (zip_uint8_t *)data;
@@ -457,7 +461,7 @@ buffer_new(const zip_buffer_fragment_t *fragments, zip_uint64_t nfragments, int
}
buffer->nfragments = j;
buffer->first_owned_fragment = free_data ? 0 : buffer->nfragments;
buffer->fragment_offsets[nfragments] = offset;
buffer->fragment_offsets[buffer->nfragments] = offset;
buffer->size = offset;
}