In rare cases (in deltas without any diffs) "sysytem.7z" archive file
would be the first file in its image directory. In this situation, a
wrong offset for the file (relative to delta) would be assumed, and as
a result a wrong file would be targeted for decompression.
Change-Id: I470854c92f9c0a1afe0bdbae134f4e63347916de
return -1;
}
- off_t last_seek = 0;
+ off_t last_seek;
int ret;
for(;;)
{
+ if ((last_seek = tar_seek(tar_data->tar, 0, SEEK_CUR)) < 0) {
+ LOGE("seeking error!\n");
+ return -1;
+ }
+
switch(th_read(tar_data->tar))
{
case -1:
LOGE("tar_skip_regfile() error!\n");
return -1;
}
-
- if ((last_seek = tar_seek(tar_data->tar, 0, SEEK_CUR)) < 0) {
- LOGE("seeking error!\n");
- return -1;
- }
}
return 0;
}