From 140a1069f9266a92b3da64e1b7cd2c54cf1784ce Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Tue, 21 Mar 2006 18:41:35 +0000 Subject: fix endless loop in case of error in archive header. --- usr.sbin/pkg_add/OpenBSD/Ustar.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'usr.sbin') 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 # @@ -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; } } -- cgit v1.2.3