svn commit: r310605 - stable/11/bin/pax

Pedro F. Giffuni pfg at FreeBSD.org
Mon Dec 26 16:42:39 UTC 2016


Author: pfg
Date: Mon Dec 26 16:42:38 2016
New Revision: 310605
URL: https://svnweb.freebsd.org/changeset/base/310605

Log:
  MFC r310367:
  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)

Modified:
  stable/11/bin/pax/buf_subs.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/bin/pax/buf_subs.c
==============================================================================
--- stable/11/bin/pax/buf_subs.c	Mon Dec 26 16:27:01 2016	(r310604)
+++ stable/11/bin/pax/buf_subs.c	Mon Dec 26 16:42:38 2016	(r310605)
@@ -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);
 		}


More information about the svn-src-stable-11 mailing list