From da370af54b419132d5f1e990f79b06ad8ebe66c0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Mon, 9 Mar 2020 11:34:21 +0100 Subject: Windows: Update libzip to 1.6.1 --- src/Common/libzip/zip_source_buffer.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/Common/libzip/zip_source_buffer.c') diff --git a/src/Common/libzip/zip_source_buffer.c b/src/Common/libzip/zip_source_buffer.c index 119bc02c..0685fb39 100644 --- a/src/Common/libzip/zip_source_buffer.c +++ b/src/Common/libzip/zip_source_buffer.c @@ -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 @@ -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; } -- cgit v1.2.3