Guard RAR seek cursor before previous block lookup
This commit is contained in:
1 parent
f3d21565cb
commit
e548c99423
1 file changed
+6
@@ -1293,6 +1293,12 @@ archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset,
|
||||
"Error during seek of RAR file");
|
||||
return (ARCHIVE_FAILED);
|
||||
}
|
||||
if (rar->cursor == 0)
|
||||
{
|
||||
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
||||
"Invalid RAR seek cursor state");
|
||||
return (ARCHIVE_FAILED);
|
||||
}
|
||||
client_offset += rar->dbo[rar->cursor].start_offset -
|
||||
rar->dbo[rar->cursor-1].end_offset;
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user