pax(1): Fix a bug with archives smaller than 512 bytes.
The problem here is that the archive is too short (< 512 bytes). The buffer routines, try to read at least 512 bytes, even when we try to determine what format file we have, which is wrong. Obtained from: NetBSD (CVS rev 1.26) MFC after: 5 days
This commit is contained in:
parent
33e7ba9cf9
commit
8ad81aaea6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=310367
@ -852,10 +852,13 @@ buf_fill(void)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* errors require resync, EOF goes to next archive
|
* errors require resync, EOF goes to next archive
|
||||||
|
* but in case we have not determined yet the format,
|
||||||
|
* this means that we have a very short file, so we
|
||||||
|
* are done again.
|
||||||
*/
|
*/
|
||||||
if (cnt < 0)
|
if (cnt < 0)
|
||||||
break;
|
break;
|
||||||
if (ar_next() < 0) {
|
if (frmt == NULL || ar_next() < 0) {
|
||||||
fini = 1;
|
fini = 1;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user