Permalink
Browse files

Merge pull request #33 from xiw/overflow

Fix overflow checking in archive_entry_sparse_add_entry()
  • Loading branch information...
2 parents 2253154 + bc533e5 commit af4124d6bc9343d39abe946614d5276505d454e4 @kientzle kientzle committed Mar 30, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 libarchive/archive_entry_sparse.c
@@ -58,7 +58,7 @@ archive_entry_sparse_add_entry(struct archive_entry *entry,
if (offset < 0 || length < 0)
/* Invalid value */
return;
- if (offset + length < 0 ||
+ if (offset > INT64_MAX - length ||
offset + length > archive_entry_size(entry))
/* A value of "length" parameter is too large. */
return;

0 comments on commit af4124d

Please sign in to comment.