diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c index 4922fc80ffa0..40affa5c0f5e 100644 --- a/bin/pax/buf_subs.c +++ b/bin/pax/buf_subs.c @@ -852,10 +852,13 @@ buf_fill(void) /* * 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) break; - if (ar_next() < 0) { + if (frmt == NULL || ar_next() < 0) { fini = 1; return(0); }