PERFORCE change 178215 for review
Garrett Cooper
gcooper at FreeBSD.org
Thu May 13 18:08:08 UTC 2010
http://p4web.freebsd.org/@@178215?ac=10
Change 178215 by gcooper at 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);
More information about the p4-projects
mailing list