summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2006-03-21 18:41:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>2006-03-21 18:41:35 +0000
commit140a1069f9266a92b3da64e1b7cd2c54cf1784ce (patch)
tree0f35c01447da549c005796181e6f542f8f70afd0 /usr.sbin
parent8767ac816d870fc31ad15b6dab06c6abb82878ea (diff)
fix endless loop in case of error in archive header.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Ustar.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm
index 6b1f88e40f2..b57e713548f 100644
--- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Ustar.pm,v 1.40 2005/10/26 09:47:48 espie Exp $
+# $OpenBSD: Ustar.pm,v 1.41 2006/03/21 18:41:34 espie Exp $
#
# Copyright (c) 2002-2004 Marc Espie <espie@openbsd.org>
#
@@ -75,6 +75,9 @@ sub skip
if (!defined $actual) {
die "Error while skipping archive: $!\n";
}
+ if ($actual == 0) {
+ die "Premature end of archive in header: $!\n";
+ }
$self->{swallow} -= $actual;
}
}