ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/src/stable/0.7/contrib/libarchive/libarchive/archive_write.c
(Generate patch)

Comparing stable/0.7/contrib/libarchive/libarchive/archive_write.c (file contents):
Revision 7618 by laffer1, Sun Aug 23 18:57:51 2015 UTC vs.
Revision 7619 by laffer1, Tue May 31 22:10:02 2016 UTC

# Line 671 | Line 671 | static ssize_t
671   _archive_write_data(struct archive *_a, const void *buff, size_t s)
672   {
673          struct archive_write *a = (struct archive_write *)_a;
674 +        const size_t max_write = INT_MAX;
675 +
676          archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
677              ARCHIVE_STATE_DATA, "archive_write_data");
678 +        /* In particular, this catches attempts to pass negative values. */
679 +        if (s > max_write)
680 +                s = max_write;
681          archive_clear_error(&a->archive);
682          return ((a->format_write_data)(a, buff, s));
683   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines