Lines Matching defs:offset
104 __u32 offset;
135 static void *check_access(struct zip_archive *archive, __u32 offset, __u32 size)
137 if (offset + size > archive->size || offset > offset + size)
140 return archive->data + offset;
146 static int try_parse_end_of_cd(struct zip_archive *archive, __u32 offset)
152 eocd = check_access(archive, offset, sizeof(*eocd));
157 if (offset + sizeof(*eocd) + comment_length != archive->size)
177 int64_t limit, offset;
185 * search for it at the end of the file, scanning the (limit, offset] range.
187 offset = archive->size - sizeof(struct end_of_cd_record);
188 limit = (int64_t)offset - (1 << 16);
190 for (; offset >= 0 && offset > limit && rc != 0; offset--) {
191 rc = try_parse_end_of_cd(archive, offset);
248 __u32 offset)
252 lfh = check_access(archive, offset, sizeof(*lfh));
259 static int get_entry_at_offset(struct zip_archive *archive, __u32 offset, struct zip_entry *out)
266 lfh = local_file_header_at_offset(archive, offset);
270 offset += sizeof(*lfh);
274 name = check_access(archive, offset, lfh->file_name_length);
278 offset += lfh->file_name_length;
279 if (!check_access(archive, offset, lfh->extra_field_length))
282 offset += lfh->extra_field_length;
284 data = check_access(archive, offset, compressed_size);
293 out->data_offset = offset;
302 __u32 i, offset = archive->cd_offset;
309 cdfh = check_access(archive, offset, sizeof(*cdfh));
313 offset += sizeof(*cdfh);
315 cdfh_name = check_access(archive, offset, cdfh_name_length);
323 memcmp(file_name, archive->data + offset, file_name_length) == 0) {
324 return get_entry_at_offset(archive, cdfh->offset, out);
327 offset += cdfh_name_length;
328 offset += cdfh->extra_field_length;
329 offset += cdfh->file_comment_length;