Avoid a potential overflow when 'skip' is larger than a pointer.
Thanks to: Joerg Sonnenberger
This commit is contained in:
parent
25d4e0e5ab
commit
96e31e81ff
@ -134,7 +134,7 @@ memory_read_skip(struct archive *a, void *client_data, off_t skip)
|
||||
struct read_memory_data *mine = (struct read_memory_data *)client_data;
|
||||
|
||||
(void)a; /* UNUSED */
|
||||
if (mine->buffer + skip > mine->end)
|
||||
if (skip > mine->end - mine->buffer)
|
||||
skip = mine->end - mine->buffer;
|
||||
/* Round down to block size. */
|
||||
skip /= mine->read_size;
|
||||
|
Loading…
Reference in New Issue
Block a user