Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2010 18:08:08 GMT
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 178215 for review
Message-ID:  <201005131808.o4DI88i8048716@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@178215?ac=10

Change 178215 by gcooper@starr-bastion on 2010/05/13 18:07:19

	Properly bound the buffer to len with the read for the archive_write*
	call.
	Cordon off the mmap(2) include. 

Affected files ...

.. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#24 edit

Differences ...

==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#24 (text+ko) ====

@@ -23,7 +23,10 @@
 
 /* XXX (gcooper): needs to come before sys/stat.h for stat(2). */
 #include <sys/types.h>
+/* Read comment below in add_file. */
+#ifdef BROKEN_MMAP
 #include <sys/mman.h>
+#endif
 #include <sys/stat.h>
 #include <assert.h>
 #include <err.h>
@@ -403,9 +406,9 @@
 					    archive_entry_buf,
 					    sizeof(archive_entry_buf));
 
-					if (archive_write_data(archive,
-					    archive_entry_buf,
-					    sizeof(archive_entry_buf)) !=
+					if (len > 0 &&
+					    archive_write_data(archive,
+					    archive_entry_buf, len) !=
 					    ARCHIVE_OK)
 						error = archive_error_string(archive);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005131808.o4DI88i8048716>