* This file is part of wimlib, a library for working with WIM files.
*
* wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
+ * terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
* any later version.
*
* wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
- * You should have received a copy of the GNU Lesser General Public License
+ * You should have received a copy of the GNU General Public License
* along with wimlib; if not, see http://www.gnu.org/licenses/.
*/
const u8 *sha1sums, int show_progress,
int *status)
{
- char *chunk_buf;
+ u8 *chunk_buf;
u8 resblock[SHA1_HASH_SIZE];
u64 bytes_remaining;
size_t bytes_to_read;
{
struct resource_entry *res_entry;
- int ctype;
u8 *buf = NULL;
int ret;
u32 integrity_table_size;
end_lookup_table_offset = w->hdr.lookup_table_res_entry.offset +
w->hdr.lookup_table_res_entry.size;
+ if (end_lookup_table_offset < WIM_HEADER_DISK_SIZE) {
+ ERROR("WIM lookup table ends before WIM header ends???");
+ ret = WIMLIB_ERR_INVALID_INTEGRITY_TABLE;
+ goto out;
+ }
+
bytes_to_check = end_lookup_table_offset - WIM_HEADER_DISK_SIZE;
expected_num_entries = (bytes_to_check + chunk_size - 1) / chunk_size;
u64 bytes_remaining;
u8 *buf;
u8 *p;
- char *chunk_buf;
+ u8 *chunk_buf;
u32 num_entries;
u32 integrity_table_size;
int ret;